This directory contains Sphinx documentation for the nmr-parser package.
Install Sphinx and theme:
uv add --dev sphinx sphinx-rtd-themecd docs/
make htmlOr using uv:
uv run sphinx-build -b html docs/ docs/_build/htmlOpen in browser:
open _build/html/index.html # macOS
xdg-open _build/html/index.html # Linuxmake cleanThe documentation uses:
- Sphinx - Documentation generator
- NumPy docstring format - Structured docstrings in code
- reStructuredText (.rst) - Documentation markup
- Read the Docs theme - Professional appearance
Sphinx automatically extracts documentation from docstrings in the code using the autodoc extension.
def read_param(file: Path, param: str) -> Optional[str]:
"""
Read parameter from Bruker file.
Parameters
----------
file : Path
Path to parameter file
param : str
Parameter name to extract
Returns
-------
str or None
Parameter value or None if not found
Examples
--------
>>> read_param('acqus', 'PULPROG')
'noesygppr1d'
"""- Create account at https://readthedocs.org
- Connect GitHub repository
- Docs build automatically on each commit
# Build docs
make html
# Copy to docs branch
git checkout -b gh-pages
cp -r _build/html/* .
git add .
git commit -m "Update docs"
git push origin gh-pagesEnable GitHub Pages in repository settings → Pages → Source: gh-pages
- autodoc - Auto-generate docs from docstrings
- napoleon - Support NumPy/Google docstrings
- viewcode - Link to source code
- intersphinx - Link to pandas, numpy, scipy docs
- autosummary - Generate API summary tables
Edit conf.py to customize:
- Theme and colors
- Extensions
- Project metadata
- Napoleon settings (docstring format)