Skip to content

Replace mkdocs with zensical and mkautodoc with mkdocstrings#930

Merged
Kludex merged 7 commits into
mainfrom
zensical-mkdocstrings
May 13, 2026
Merged

Replace mkdocs with zensical and mkautodoc with mkdocstrings#930
Kludex merged 7 commits into
mainfrom
zensical-mkdocstrings

Conversation

@Kludex
Copy link
Copy Markdown
Member

@Kludex Kludex commented May 13, 2026

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.toml docs group: drop mkdocs, mkdocs-material, mkautodoc; add zensical>=0.0.41 and mkdocstrings[python]>=0.27. Added exclude-newer-package override for zensical = "2026-05-10" since 0.0.41 was published outside the 7-day window.
  • mkdocs.yml: remove mkautodoc from markdown_extensions, add a plugins: 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: swap mkdocs build/serve -> zensical build/serve -f mkdocs.yml.
  • Closes Move to zensical and support objects.inv #929

Notes

  • zensical is still alpha (0.0.41). Build succeeded locally in 0.83s; the 9 warnings it emitted are all pre-existing broken anchors in the docs content (not migration regressions).
  • Run ./scripts/docs to preview locally.

Test plan

  • ./scripts/build succeeds locally
  • Visual check of rendered docs (api, exceptions, index, etc.)

AI Disclaimer

This PR was developed with the assistance of either Claude or Codex. I've reviewed and verified the changes.

Kludex added 7 commits May 13, 2026 08:27
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.
@Kludex Kludex merged commit f1fc9ba into main May 13, 2026
11 checks passed
@Kludex Kludex deleted the zensical-mkdocstrings branch May 13, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move to zensical and support objects.inv

1 participant