Skip to content

Commit 1c5988d

Browse files
committed
add cross-links to py docs
1 parent 5115504 commit 1c5988d

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

AGENTS.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ Changes to `rawpy/_rawpy.pyx` or C++ files **will not take effect** until you re
3939
| Run all tests | `pytest test/` |
4040
| Type check | `mypy rawpy` |
4141
| Switch numpy version | `bash scripts/setup_numpy.sh 2.0.2` |
42+
| Build docs | `cd docs && sphinx-build -b html . _build/html` |
43+
| Serve & view docs | `cd docs/_build/html && python -m http.server 8765` then open `http://localhost:8765` |
4244

4345
> **System libraw requires LibRaw ≥ 0.21.** Ubuntu 22.04's `libraw-dev` (0.20.2) is
4446
> too old. Use Ubuntu 24.04+ or build without `RAWPY_USE_SYSTEM_LIBRAW`.
@@ -95,6 +97,22 @@ source .venv/bin/activate
9597

9698
## Common Tasks
9799

100+
### Building and viewing documentation
101+
102+
The docs use Sphinx with the Read the Docs theme. Both are already installed
103+
in the dev venv (via `dev-requirements.txt`).
104+
105+
1. Build: `cd docs && sphinx-build -b html . _build/html`
106+
2. Serve: `cd docs/_build/html && python -m http.server 8765` (run as background process)
107+
3. Open `http://localhost:8765` in the Simple Browser
108+
109+
- Source files: `docs/index.rst`, `docs/api/*.rst`
110+
- Config: `docs/conf.py`
111+
- Output: `docs/_build/html/` (git-ignored)
112+
- The docs use `autodoc` to pull docstrings from the built Cython extension,
113+
so `rawpy._rawpy` must be importable (i.e., the extension must be compiled).
114+
Run `bash scripts/rebuild.sh` first if needed.
115+
98116
### Adding a new LibRaw method
99117

100118
1. Find the C++ signature in `external/LibRaw/libraw/libraw.h`

docs/conf.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
# ones.
2828
extensions = [
2929
"sphinx.ext.autodoc",
30+
"sphinx.ext.intersphinx",
3031
"sphinx.ext.todo",
3132
]
3233

@@ -261,3 +262,8 @@
261262
# texinfo_no_detailmenu = False
262263

263264
autoclass_content = "both"
265+
266+
intersphinx_mapping = {
267+
"python": ("https://docs.python.org/3", None),
268+
"numpy": ("https://numpy.org/doc/stable", None),
269+
}

0 commit comments

Comments
 (0)