Skip to content

Migrate the documentation from MkDocs to Zensical - #98

Open
kattni wants to merge 4 commits into
beeware:mainfrom
kattni:tooling/zensical-migration
Open

kattni wants to merge 4 commits into
beeware:mainfrom
kattni:tooling/zensical-migration

Conversation

@kattni

@kattni kattni commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Moves the tutorial's documentation from MkDocs and Material for MkDocs to Zensical, with Zensical-native configuration.

This depends on beeware/beeware-docs-tools#288. docs-tools is temporarily pinned to that PR's branch (kattni/beeware-docs-tools@tooling/zensical-migration) in pyproject.toml. The pin is reverted to beeware/beeware-docs-tools once #288 is merged.

Weblate must be locked and synced before this is merged. The translations.po files change in all 7 languages (de, es, fr, it, pt, zh_CN, zh_TW), so merging while Weblate has pending changes would conflict.

Changes

  • docs/config.yml and docs/mkdocs.<lang>.yml are replaced by docs/zensical.toml and docs/zensical.<lang>.toml. These were generated with docs-tools' convert_mkdocs_config, which checked the result against the YAML for every language.
  • docs/en/SUMMARY.md (literate-nav) is replaced by the native nav setting in docs/zensical.toml.
  • The navigation titles' translations are migrated to PO entries with msgctxt "navigation", which nav titles use. In every language:
    • The 13 entries that only came from SUMMARY.md are removed.
    • 15 navigation entries are added, carrying over the translations and fuzzy flags.
    • No other entry's text, flags or references change.
  • site_url is set once in zensical.toml. docs-tools adds <lang>/ for each translation, so the canonical URLs and sitemaps are the same as before.
  • The redirects settings are kept, because Zensical implements redirects natively. The mkdocs-redirects dependency group is removed.
  • The DISABLE_MKDOCS_2_WARNING and NO_MKDOCS_2_WARNING settings are removed from tox.ini. docs/_build.*.toml is added to .gitignore, and the rumdl ignore for SUMMARY.md is dropped.

Verification

  • tox -r -e docs-all: all 8 languages build in strict mode with "No issues found".
  • Compared against a MkDocs build of main with the current docs-tools, in every language:
    • The same 17 pages per language, and identical article text on all 136 pages.
    • The sidebar navigation's labels, nesting and links are identical on every page. The header tabs are also identical.
    • Images and resources are present and byte-identical in every translated site.
    • The redirect pages are byte-identical.
    • No macro fails. The OS tabs are identical in both builds (302 tabbed sets), and selecting a tab switches the linked tabs.
    • Sitemaps list the same URLs, except that the MkDocs build also listed a dead /SUMMARY/ page.
  • Visual check in light and dark mode, in English and German: the only difference is Zensical's search box.
  • Translation pipeline dry run (build_pot_translations, then build_po_translations for all 7 languages, without DeepL):
    • No translation is changed or dropped, and every navigation entry keeps its translation.
    • No ::: strings appear.
    • The next regeneration only reorders the navigation entries next to their page headings and fills in their titles.md line references.

Notes for reviewers

  • "Going further": in SUMMARY.md, this was both a section label and its index page's title, and de, es, zh_CN and zh_TW translated the two differently. MkDocs showed the section label's translation in the sidebar, but the index page's in that page's <title> and in the previous/next footer links. One navigation entry can't reproduce both. I kept the sidebar wording (shown on every page), so in those 4 languages the topics page's <title>, and 2 footer links, now use the sidebar wording (for example German "Weiterführende Informationen" instead of "Weiterführend").
  • Existing language tag: in extra.alternate, 中文(简体) has lang = "zh-Hant" (Traditional Chinese); zh-Hans is probably intended. This is carried over unchanged, to keep this PR a straight migration.
  • zh_TW shows "Customizing icons" and "Testing times" in English in the sidebar, as it does now, because those entries were never translated.
  • There's no change note, because this repository doesn't use towncrier.

PR Checklist:

  • I will abide by the BeeWare Code of Conduct
  • I have read and have followed the CONTRIBUTING.md file
  • This PR was generated or assisted using an AI tool

Assisted-by: Claude Code (Claude Opus 5.5)

… settings.

docs-tools is temporarily pinned to the branch of beeware/beeware-docs-tools#288,
which builds the documentation with Zensical. The pin is reverted once that PR is
merged.

Zensical implements redirects natively, so mkdocs-redirects is no longer needed.
The MkDocs 2 warning variables in tox.ini are no longer needed. The build's
temporary configuration files are ignored.
Generated with docs-tools' convert_mkdocs_config. docs/config.yml and the
per-language docs/mkdocs.<lang>.yml files become docs/zensical.toml and
docs/zensical.<lang>.toml. The literate-nav docs/en/SUMMARY.md becomes the
native nav setting in docs/zensical.toml.

The navigation titles' translations in docs/locales/*/translations.po are
migrated to entries with the "navigation" context, which nav titles use. Entries
that only came from SUMMARY.md are removed. No other entry is changed.
The converter kept each language's literal site_url in its language file, where
it isn't a per-language setting and produces a warning. docs-tools adds the
language directory to the base site_url for each translation, so setting
https://tutorial.beeware.org/ once gives the same site URL for every language.
In SUMMARY.md, "Going further" was both a section label and the title of the
section's index page, and de, es, zh_CN and zh_TW translated the two
differently. With navigation.indexes, the sidebar showed the section label's
translation, but the converter migrated the index page's. The navigation entry
now has the section label's translation (and its fuzzy flag), so the sidebar is
unchanged.

This branch has not been deployed

No deployments
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.

1 participant