Replace mkdocs with zensical and mkautodoc with mkdocstrings#930
Merged
Conversation
zensical (0.0.41) is a successor to mkdocs from the Material for MkDocs team that reads the existing mkdocs.yml format directly. mkdocstrings replaces mkautodoc as the Python autodoc plugin. Changes: - pyproject.toml docs group: drop mkdocs, mkdocs-material, mkautodoc; add zensical and mkdocstrings[python]. Added exclude-newer-package override for zensical 0.0.41 (published 2026-05-09). - mkdocs.yml: remove mkautodoc from markdown_extensions, add a plugins block configuring mkdocstrings' Python handler. - docs/api.md and docs/exceptions.md: convert the 39 ::: directives from mkautodoc syntax (:docstring:, :members: a b c) to mkdocstrings syntax (docstring is implicit; members as a YAML list). - scripts/build, scripts/docs: swap mkdocs build/serve for zensical.
zensical doesn't enable fenced_code by default, so the existing codehilite extension was producing no output and the triple-backtick fences were leaking through as plain text. Switch to pymdownx.highlight + pymdownx.superfences (already a transitive zensical dep), which properly highlights both python and pycon blocks.
Enable mkdocstrings' separate_signature option with a 60-char line budget so long signatures (httpx2.request, httpx2.get, Client/AsyncClient methods) format Black-style with each parameter on its own line instead of wrapping mid-name.
Client and AsyncClient inherit headers, cookies, params, auth, and build_request from BaseClient. mkdocstrings skips inherited members by default, which dropped them from the rendered API reference even though api.md explicitly listed them. Enable inherited_members globally to restore them. Spotted by codex review.
Zensical's stylesheet only styles a subset of pygments tokens (n, p, nn, no, nt, ow, kt, mo, ...). Common ones like gp (>>> prompt), o (operators), nb (builtins), nf (function names), kc (None/True/False), s/s1/s2 (strings), m/mi (numbers), c/c1 (comments), and k* (keywords) were rendered colorless. Map them to zensical's existing --md-code-hl-* CSS variables so they inherit the active palette. The previous div.autodoc-* rules were for mkautodoc's wrapper divs; mkdocstrings doesn't emit those classes, so they've been removed.
This reverts commit 6435090.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrate the docs build off mkdocs onto zensical (the Material for MkDocs team's successor, mkdocs.yml-compatible), and replace mkautodoc with mkdocstrings for Python API autodocs.
pyproject.tomldocs group: dropmkdocs,mkdocs-material,mkautodoc; addzensical>=0.0.41andmkdocstrings[python]>=0.27. Addedexclude-newer-packageoverride forzensical = "2026-05-10"since 0.0.41 was published outside the 7-day window.mkdocs.yml: removemkautodocfrommarkdown_extensions, add aplugins:block configuring the mkdocstrings Python handler.docs/api.md,docs/exceptions.md: convert the 39:::directives from mkautodoc syntax (:docstring:,:members: a b c) to mkdocstrings syntax (docstring is implicit; members as a YAML list).scripts/build,scripts/docs: swapmkdocs build/serve->zensical build/serve -f mkdocs.yml.objects.inv#929Notes
./scripts/docsto preview locally.Test plan
./scripts/buildsucceeds locallyAI Disclaimer
This PR was developed with the assistance of either Claude or Codex. I've reviewed and verified the changes.