| 1 |
# Docs CLAUDE.md |
| 2 |
|
| 3 |
## Building Documentation |
| 4 |
|
| 5 |
```bash |
| 6 |
cd docs && source ~/.venvs/deep/bin/activate && python buildme.py |
| 7 |
``` |
| 8 |
|
| 9 |
The build output goes to `~/Workspace/sites/blog/public/deepdiff/<version>/` (configured via `docs/.env`). |
| 10 |
To verify changes, check the generated HTML, e.g. `~/Workspace/sites/blog/public/deepdiff/8.7.0/faq.html`. |
| 11 |
|
| 12 |
The Sphinx doctree cache is stored in `/tmp/sphinx_doctree`. The build script clears it each run. If you get permission errors on that directory, ask the user to `rm -rf /tmp/sphinx_doctree` first. |
| 13 |
|
| 14 |
## Theme |
| 15 |
|
| 16 |
Uses the **Furo** Sphinx theme. Key customizations: |
| 17 |
|
| 18 |
- **Font**: Open Sans, loaded via `_static/custom.css` and set in `conf.py` via `light_css_variables` / `dark_css_variables` |
| 19 |
- **Footer**: Custom `_templates/page.html` overrides the default footer to remove Sphinx/Furo credit while keeping the copyright notice |
| 20 |
- **GA4**: Google Analytics tag (`G-KVVHD37BKD`) is injected via `_templates/page.html` in the `extrahead` block |
| 21 |
- **Pygments**: Uses Furo's default syntax highlighting (no explicit `pygments_style` set) |
| 22 |
|
| 23 |
## Symlinked Docstrings |
| 24 |
|
| 25 |
Some RST files in `docs/` (e.g., `diff_doc.rst`, `deephash_doc.rst`, `search_doc.rst`) are symlinks to `deepdiff/docstrings/`. The files need to exist in both places: |
| 26 |
|
| 27 |
- **`deepdiff/docstrings/`** — So they're included in the generated wheel. `flit_core` (our build system) only packages files under the `deepdiff/` directory, and these are loaded at runtime by `get_doc()` in `helper.py` to serve as Python docstrings. |
| 28 |
- **`docs/`** — So Sphinx can find and build them as documentation pages. |
| 29 |
|
| 30 |
These files have a `:orphan:` directive on line 1 (needed by Sphinx to suppress toctree warnings). `get_doc()` strips it at runtime so it doesn't appear in the Python docstrings. |
| 31 |
|
| 32 |
## File Structure |
| 33 |
|
| 34 |
- `conf.py` — Sphinx configuration |
| 35 |
- `buildme.py` — Build script (reads `.env` for `BUILD_PATH` and `DOC_VERSION`) |
| 36 |
- `_templates/page.html` — Extends `furo/page.html` for GA4 and custom footer |
| 37 |
- `_static/custom.css` — Loads Open Sans font from Google Fonts |