Skip to content

Commit 41c7265

Browse files
committed
fixing docs
1 parent 563c51e commit 41c7265

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

deepdiff/helper.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,7 @@ def get_doc(doc_filename: str) -> str:
400400
try:
401401
with open(os.path.join(current_dir, 'docstrings', doc_filename), 'r') as doc_file:
402402
doc = doc_file.read()
403+
doc = doc.replace(':orphan:\n\n', '', 1)
403404
except Exception: # pragma: no cover
404405
doc = 'Failed to load the docstrings. Please visit: https://zepworks.com/deepdiff/current/' # pragma: no cover
405406
return doc

docs/CLAUDE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ Uses the **Furo** Sphinx theme. Key customizations:
2020
- **GA4**: Google Analytics tag (`G-KVVHD37BKD`) is injected via `_templates/page.html` in the `extrahead` block
2121
- **Pygments**: Uses Furo's default syntax highlighting (no explicit `pygments_style` set)
2222

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+
2332
## File Structure
2433

2534
- `conf.py` — Sphinx configuration

0 commit comments

Comments
 (0)