Docs/migrate to zensical#76
Merged
Merged
Conversation
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.
Documentation: migrate from MkDocs to Zensical
This branch moves the documentation toolchain from Material for MkDocs to Zensical, the successor static-site generator from the same authors. The site configuration is rewritten from
mkdocs.ymlintozensical.toml, the docs dependency set is swapped accordingly, a GitHub Pages deploy workflow is added (the project previously had none), and a few Markdown constructs that MkDocs silently tolerated are corrected so the new, stricter build passes cleanly. The documentation content, structure, theme, custom palette, and API reference all carry over unchanged in appearance.Configuration moved from
mkdocs.ymltozensical.tomlThe docs were configured through a
mkdocs.ymlconsumed by Material for MkDocs. Zensical can readmkdocs.ymlfor compatibility, but the project's configuration is now expressed natively inzensical.toml, which is where Zensical projects are meant to live. The translation is faithful: the same site metadata, themoderntheme, the navigation tree, the Markdown extension set, and the mkdocstrings-driven API reference are all preserved. The custom brand color survives too — the palette keepsprimary = "custom", which continues to read--md-primary-fg-color: #a47beafrom the existingdocs/stylesheets/extra.css, so the purple is identical to before.Three MkDocs-era plugins did not carry over, each for a concrete reason. The
searchplugin is gone because Zensical ships search as a built-in rather than a plugin. Themeta-descriptionsplugin is gone because Zensical has no equivalent — the site-widesite_descriptionstill applies, but per-page auto-generated meta descriptions no longer are. And Google Analytics, whichmkdocs.ymlwired up by injectingGOOGLE_ANALYTICS_KEYthrough MkDocs'!ENVYAML tag, is not carried intozensical.toml: TOML has no!ENVmechanism and Zensical configures analytics through its own system, so re-enabling it is a deliberate follow-up rather than a mechanical translation.Why:
mkdocs.ymlwas kept only as a transition aid. Expressing the configuration inzensical.tomlis the supported, forward-looking form and matches the sibling projects (fastcrud,fastroai-template,FastAPI-boilerplate) that have already migrated.A GitHub Pages deploy pipeline
The repository had no documentation CI at all — docs were built and pushed by hand. This adds
.github/workflows/docs.yml, which on every push tomaininstalls the docs dependencies withuv sync --extra docs, builds the site withuv run zensical build, and publishes it to GitHub Pages via the officialupload-pages-artifact/deploy-pagesactions. The workflow declares least-privilege permissions (contents: read, pluspages: writeandid-token: writefor the Pages deployment) and apagesconcurrency group so overlapping runs don't race.Why: It uses
uv run zensicalagainst the project's docs environment rather thanuvx zensical, because the mkdocstrings plugin lives in a separate package that an isolateduvxtool environment wouldn't include — the build needs Zensical and mkdocstrings installed together.Markdown that MkDocs tolerated and Zensical flags
Zensical validates intra-site links and anchors more strictly than MkDocs did, which surfaced three latent issues in the existing content. A type annotation written as
Set[str]in a table cell was being parsed as a Markdown link reference — it's now wrapped in backticks. A placeholder"+ Add [ModelName]"had the same problem and now escapes its brackets. And a "Quick setup example" link pointed atconfiguration.md#basic-example, an anchor that does not exist; it now targets#minimal-setup, the section it was always meant to reach.These were pre-existing defects that MkDocs rendered without complaint, not regressions introduced by the migration. With them fixed,
zensical buildreports "No issues found."Test Plan
Automated
uv run zensical build— "No issues found" (clean build, zero warnings)uv sync --extra docs+uv run zensical buildfrom a clean env — succeeds (CI parity with the new workflow)uv run pytest— 345 passed (the migration touches only docs/config, so the package is unaffected)Migration fidelity
site/api/crud_admin/index.htmlis generated with content)primary = "custom"+extra.cssstill applied;stylesheets/extra.csscopied into the buildmkdocs.ymlDeploy
docs.ymlworkflow added with Pages permissions and concurrency; runszensical buildand deploys./site(exercised on merge tomain)Dependencies
docsextra:mkdocs,mkdocs-material,mkdocs-meta-descriptions-plugin.zensical>=0.0.15,mkdocs-autorefs>=1.0,<2;mkdocstrings[python]bumped to>=1.0,<2.mkdocsstill appears inuv.lockas a transitive dependency of Zensical/mkdocstrings, but is no longer a direct dependency of this project.Breaking Changes
mkdocs build/mkdocs serve/mkdocs gh-deployno longer work — there's nomkdocs.ymland nomkdocs-material. Build and preview withuv run zensical buildanduv run zensical serve(afteruv sync --extra docs). Noteuvx zensicalwill fail with "mkdocstrings is not installed" because the isolated tool env lacks the mkdocstrings package — useuv run, oruvx --with mkdocstrings-python zensical.GOOGLE_ANALYTICS_KEYenv injection frommkdocs.ymlwas not ported. Until it's re-added through Zensical's analytics configuration, the docs site emits no analytics.meta-descriptionsplugin has no Zensical equivalent; only the site-widesite_descriptionis emitted now.