Skip to content

docs: replace MkDocs with Zensical for the documentation website#1340

Merged
giswqs merged 5 commits into
masterfrom
docs/replace-mkdocs-with-zensical
Jul 6, 2026
Merged

docs: replace MkDocs with Zensical for the documentation website#1340
giswqs merged 5 commits into
masterfrom
docs/replace-mkdocs-with-zensical

Conversation

@giswqs

@giswqs giswqs commented Jul 6, 2026

Copy link
Copy Markdown
Member

Summary

  • Replace the MkDocs + Material documentation stack with Zensical, the successor static site generator from the Material for MkDocs team. mkdocs.yml is replaced by a native zensical.toml carrying over the site metadata, theme, navigation, mkdocstrings API reference, Google Analytics, and Markdown extensions.
  • Add scripts/convert_notebooks.py, which converts all 243 documentation notebooks to Markdown with nbconvert before the build, since Zensical does not yet support the mkdocs-jupyter plugin. The original .ipynb files are still copied to the site and remain downloadable. Generated Markdown is gitignored.
  • Update requirements_docs.txt (drop mkdocs packages, add zensical) and the docs workflows: the deploy workflow now publishes the Zensical build to GitHub Pages with peaceiris/actions-gh-pages, and the PR preview workflow builds with Zensical before deploying to Netlify.

Test plan

  • python scripts/convert_notebooks.py converts 243/243 notebooks with language-tagged code fences
  • zensical build completes with "No issues found" (about 1 second warm build)
  • Verified in a browser: homepage, notebook pages (syntax highlighting, copy buttons, table of contents), mkdocstrings API reference pages, and built-in search all render correctly
  • CNAME, sitemap, 404 page, analytics tag, and raw notebook downloads present in the built site
  • pre-commit run --all-files passes
  • Confirm the docs-build workflow's Netlify preview renders correctly on this PR

Summary by CodeRabbit

  • New Features
    • Documentation publishing now converts notebooks to Markdown automatically before building the site.
    • Generated pages include accompanying extracted assets for richer notebook content.
  • Chores
    • Updated CI workflows to use the new documentation build/deploy flow and build output for GitHub Pages.
    • Adjusted documentation dependencies and site configuration; set explicit deployment permissions.
    • Excluded generated notebook Markdown and assets from version control.
  • Documentation
    • Removed the previous documentation site configuration and template override.

Zensical is the successor to Material for MkDocs from the same team, with
much faster builds and native mkdocstrings support. Since Zensical does not
yet support mkdocs-jupyter, notebooks are converted to Markdown pages with
nbconvert at build time via scripts/convert_notebooks.py.
Copilot AI review requested due to automatic review settings July 6, 2026 20:45
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 1b92bcad-7303-4947-8a23-ae2da53ac086

📥 Commits

Reviewing files that changed from the base of the PR and between e006515 and f0f8241.

📒 Files selected for processing (2)
  • .github/workflows/docs.yml
  • zensical.toml

📝 Walkthrough

Walkthrough

The docs pipeline now converts notebooks to Markdown, builds the site with Zensical, and deploys the generated output to GitHub Pages. The docs configuration, generated-file handling, and documentation dependencies were updated to match the new workflow.

Changes

MkDocs to Zensical Migration

Layer / File(s) Summary
Notebook conversion and generated files
scripts/convert_notebooks.py, .gitignore
Notebook conversion now runs in parallel, writes Markdown plus per-notebook asset folders, and fails the build on conversion errors; generated notebook Markdown and asset directories are ignored except for docs/maplibre/overview.md.
Zensical site configuration
zensical.toml
Project metadata, navigation, theme settings, mkdocstrings options, analytics, and markdown extensions are defined for the Zensical site.
Build, deploy, and docs dependencies
.github/workflows/docs-build.yml, .github/workflows/docs.yml, requirements_docs.txt
Docs workflows install updated requirements, convert notebooks, build with zensical build, and publish ./site with GitHub Pages actions; the docs requirements add zensical and tomli<2.2 while removing MkDocs-related packages.

Estimated code review effort: 2 (Simple) | ~12 minutes

Sequence Diagram(s)

sequenceDiagram
    participant GitHubActions
    participant convert_notebooks.py
    participant zensical build
    participant GitHub Pages

    GitHubActions->>convert_notebooks.py: run notebook conversion
    convert_notebooks.py-->>GitHubActions: generated Markdown and assets
    GitHubActions->>zensical build: build site
    zensical build-->>GitHubActions: ./site output
    GitHubActions->>GitHub Pages: deploy ./site
Loading

Poem

Hop, hop, the docs build changed its tune,
Notebooks bloom to Markdown by afternoon. 🐇
Zensical hums, the pages take their place,
GitHub Pages gets the finished face.
A tidy trail of carrots leads the way!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: replacing MkDocs with Zensical for the docs site.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/replace-mkdocs-with-zensical

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mergify

mergify Bot commented Jul 6, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates the project’s documentation site from the MkDocs + Material stack to Zensical, updating configuration, dependencies, and CI/CD workflows to build and deploy the new site while preserving notebook-based content.

Changes:

  • Replace mkdocs.yml with zensical.toml, carrying over site metadata, navigation, theme settings, mkdocstrings config, analytics, and Markdown extensions.
  • Add a pre-build notebook conversion script (scripts/convert_notebooks.py) to generate Markdown pages from .ipynb docs content for Zensical.
  • Update docs dependencies and CI workflows to build with Zensical and deploy to GitHub Pages / Netlify previews.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
zensical.toml New Zensical site configuration mirroring prior MkDocs settings (nav/theme/plugins/extensions).
scripts/convert_notebooks.py Converts docs notebooks to Markdown + extracted assets prior to Zensical build.
requirements_docs.txt Removes MkDocs-related packages; adds zensical and keeps nbconvert/nbformat + mkdocstrings tooling.
mkdocs.yml Removed MkDocs configuration after migration to Zensical.
docs/overrides/main.html Removes MkDocs theme override that was specific to the prior stack.
.gitignore Ignores generated Markdown pages and _files/ assets emitted by notebook conversion.
.github/workflows/docs.yml Builds docs via notebook conversion + zensical build, then deploys via peaceiris/actions-gh-pages.
.github/workflows/docs-build.yml Updates PR preview build to use notebook conversion + zensical build prior to Netlify deploy.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/docs.yml
tomli 2.2+ ships mypyc-compiled wheels that crash with "extension module
'tomli' is already cached" on Python 3.13 when imported by zensical
(python/cpython#123880), breaking the docs
build in CI. Also grant the docs deploy job contents:write explicitly so
peaceiris/actions-gh-pages can push to gh-pages under least-privilege
token settings.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/docs.yml:
- Around line 67-72: The GitHub Pages deploy step in the docs workflow uses a
mutable version tag for peaceiris/actions-gh-pages, which should be pinned to a
specific commit SHA. Update the uses reference in the Deploy to GitHub Pages
step to the resolved SHA for the intended v4 release, keeping the existing with
settings (github_token, publish_dir, force_orphan) unchanged. Use the action
identifier peaceiris/actions-gh-pages@v4 as the target to replace with the
pinned commit reference.
- Around line 67-72: The Deploy to GitHub Pages step in the docs workflow still
references peaceiris/actions-gh-pages@v4 instead of a fixed commit. Update the
uses value in the Deploy to GitHub Pages job to pin peaceiris/actions-gh-pages
to a specific commit SHA, keeping the existing github_token, publish_dir, and
force_orphan settings unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ae5d98e7-a6e2-467a-bd32-929a11649151

📥 Commits

Reviewing files that changed from the base of the PR and between 5ee4426 and b0dee56.

📒 Files selected for processing (8)
  • .github/workflows/docs-build.yml
  • .github/workflows/docs.yml
  • .gitignore
  • docs/overrides/main.html
  • mkdocs.yml
  • requirements_docs.txt
  • scripts/convert_notebooks.py
  • zensical.toml
💤 Files with no reviewable changes (2)
  • mkdocs.yml
  • docs/overrides/main.html

Comment thread .github/workflows/docs.yml
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

@github-actions github-actions Bot temporarily deployed to pull request July 6, 2026 20:53 Inactive
- Pin peaceiris/actions-gh-pages to the v4.0.0 commit SHA to reduce
  supply-chain risk from mutable tags.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/docs.yml (1)

20-20: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Stale USE_MKDOCS env var.

Now that the build no longer uses MkDocs, this secret reference appears to be dead configuration left over from the old toolchain.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/docs.yml at line 20, The workflow still references the
obsolete USE_MKDOCS secret in the docs job, which is dead configuration now that
MkDocs is no longer used. Remove the USE_MKDOCS environment entry from the docs
workflow and keep the remaining job configuration unchanged; use the docs build
job in docs.yml to locate and clean up the stale variable.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/docs.yml:
- Around line 11-12: Add a brief explanatory comment next to the docs workflow
permissions block to justify why contents: write is required. Update the
permissions section in the docs workflow so the reason is clear to static
analysis, keeping the comment close to the existing permissions entry and
referencing the workflow’s publish or docs update step context if needed.

---

Outside diff comments:
In @.github/workflows/docs.yml:
- Line 20: The workflow still references the obsolete USE_MKDOCS secret in the
docs job, which is dead configuration now that MkDocs is no longer used. Remove
the USE_MKDOCS environment entry from the docs workflow and keep the remaining
job configuration unchanged; use the docs build job in docs.yml to locate and
clean up the stale variable.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 311b6016-5921-4d01-b8a5-83f0a86c23a8

📥 Commits

Reviewing files that changed from the base of the PR and between b0dee56 and e006515.

📒 Files selected for processing (2)
  • .github/workflows/docs.yml
  • requirements_docs.txt

Comment thread .github/workflows/docs.yml
- Document why the docs deploy job needs contents: write.
@github-actions github-actions Bot temporarily deployed to pull request July 6, 2026 20:58 Inactive
Zensical derives nav titles from a page's first H1 when present and the
filename otherwise, producing a mixed navigation menu. Set explicit
filename-based titles on all notebook-derived nav entries.
@giswqs giswqs merged commit 4785fc0 into master Jul 6, 2026
21 checks passed
@giswqs giswqs deleted the docs/replace-mkdocs-with-zensical branch July 6, 2026 21:27
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.

2 participants