Skip to content

Commit 6e9b010

Browse files
committed
docs: migrate from Sphinx to MkDocs + Material for MkDocs
Replace the Sphinx toolchain (sphinx, sphinx-autoapi, sphinx-rtd-theme, myst-parser) with MkDocs + Material + mkdocstrings. Read the Docs keeps hosting the site. - pyproject: swap the `docs` dependency group; ignore two pymdown-extensions advisories only fixed for Python >=3.10 (docs-only dep, same rationale as the existing uv.audit ignores) - mkdocs.yaml: new config -- Material theme, mkdocstrings python handler, nav, site_dir: var/html-docs, toc_depth "2-6" - docs/: drop conf.py, index.rst and the committed sphinx-autoapi docs/modules/ tree; add index.md, configuration.md and hand-written reference/*.md mkdocstrings stubs for the five modules - docs/readme.md: absolute raw-GitHub image URL and an RTD link so the PyPI long description renders (relative paths only resolve on GitHub) - src: rewrite the reStructuredText-flavoured module/function docstrings in __init__.py and status.py as Markdown so mkdocstrings renders them - .readthedocs.yaml: `mkdocs:` key instead of `sphinx:`, drop pdf output (Sphinx-only on RTD), keep htmlzip - justfile: .just/sphinx.justfile -> .just/mkdocs.justfile Dropped mkdocs-gen-files / mkdocs-literate-nav / mkdocs-section-index: they now depend on `properdocs`, a MkDocs fork that pulls a second site generator into the tree and injects promotional build output. Five modules do not need generated nav.
1 parent 2c5f646 commit 6e9b010

25 files changed

Lines changed: 713 additions & 1057 deletions

.just/mkdocs.justfile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# MkDocs + Material -- see ../mkdocs.yaml
2+
3+
4+
# show which mkdocs is used
5+
[group: 'mkdocs']
6+
mkdocs-which:
7+
@ which mkdocs
8+
9+
10+
# build the static site into var/html-docs (strict: fail on broken refs/links)
11+
[group: 'mkdocs']
12+
mkdocs-docs:
13+
mkdocs build --strict
14+
@echo
15+
@echo "Build finished -> var/html-docs (see site_dir in ../mkdocs.yaml)"
16+
17+
18+
# Extra args pass through, e.g.
19+
# just mkdocs-serve -a 0.0.0.0:8000 # bind all interfaces (then browse localhost, NOT 0.0.0.0)
20+
# just mkdocs-serve --no-strict
21+
# live-reloading preview on http://127.0.0.1:8000/ (or http://localhost:8000/ from a WSL2 browser)
22+
[group: 'mkdocs']
23+
mkdocs-serve *args:
24+
mkdocs serve {{ args }}
25+
26+
27+
# alias for mkdocs-docs
28+
alias docs := mkdocs-docs

.just/sphinx.justfile

Lines changed: 0 additions & 19 deletions
This file was deleted.

.readthedocs.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@ build:
2222

2323
formats:
2424
- htmlzip
25-
- pdf
26-
# - epub
27-
# - all
25+
# pdf/epub are Sphinx-only on Read the Docs and not available for MkDocs builds.
2826

29-
sphinx:
30-
configuration: docs/conf.py
31-
fail_on_warning: false # true is too strict
27+
mkdocs:
28+
configuration: mkdocs.yaml
29+
fail_on_warning: false # Material for MkDocs prints an (unsuppressable) MkDocs-2.0 banner

docs/changes.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file.
44

55
## 1.0.7 (unreleased)
66

7+
- Migrate the documentation from Sphinx to MkDocs + Material for MkDocs. The API
8+
reference is now generated by `mkdocstrings` (Python handler) instead of
9+
`sphinx-autoapi`; `docs/conf.py`, `docs/index.rst` and the committed
10+
`docs/modules/` tree are gone, replaced by `mkdocs.yaml`, `docs/index.md` and
11+
`docs/reference/*.md`. Read the Docs keeps hosting the site (`htmlzip` output
12+
retained; `pdf` dropped -- Sphinx-only on RTD). Module/function docstrings that
13+
used reStructuredText markup (`.. code-block::`, `:func:` / `:class:` roles)
14+
were rewritten in Markdown so they render correctly. Adds a `docs/configuration.md`
15+
page documenting the `AUTOREAD_DOTENV_PATH` and `AUTOREAD_ENFORCE_DOTENV`
16+
environment-variables, which must be set outside `.env`.
17+
718
- Narrow the blanket `except OSError` in `get_dotenv_path()`. `PermissionError` from
819
`is_file()` itself (the documented Python < 3.12 case of an unreadable parent directory)
920
still returns the path optimistically and defers to `load_dotenv()`. Any other `OSError`

docs/conf.py

Lines changed: 0 additions & 272 deletions
This file was deleted.

0 commit comments

Comments
 (0)