Skip to content

Migrate docs to Zensical and deploy via GitHub Actions - #81

Merged
will-ockmore merged 5 commits into
mainfrom
docs-zensical-pages
Jul 7, 2026
Merged

Migrate docs to Zensical and deploy via GitHub Actions#81
will-ockmore merged 5 commits into
mainfrom
docs-zensical-pages

Conversation

@will-ockmore

@will-ockmore will-ockmore commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary

Migrates the documentation from Material for MkDocs to Zensical (the successor built by the same team) and modernizes GitHub Pages publishing to a first-party GitHub Actions deployment. Closes #73.

This also resolves the class of failure seen recently where the docs deploy failed with a generic "Deployment failed, try again later" — that came from GitHub's hidden legacy pages-build-deployment workflow triggered by pushing to the gh-pages branch. The deploy now runs in our workflow, with visible logs and trivial re-runs.

What changed

Docs → Zensical

  • Add zensical.toml (replacing mkdocs.yml) with equivalent nav, deep-purple palette, light/dark toggle, and the markdown extensions the content actually uses (admonition, details, superfences, footnotes, highlight).
  • mkdocstrings still auto-generates the API reference — all 20 API symbols render identically and cross-references resolve (the mkdocstrings-linking gap noted in httpx forks - is the library compatible? #73 is now supported in Zensical).
  • Swap the mkdocs-material dev dependency for zensical.
  • scripts/build now runs zensical build --clean --strict.
  • Small polish: title: API front matter so the API page heading reads "API"; docs/stylesheets/extra.css to drop the underline on the badge links.

Pages → GitHub Actions (after a successful release)

  • Add .github/workflows/docs.yml: build with Zensical and deploy via configure-pages / upload-pages-artifact / deploy-pages. Actions are SHA-pinned to match repo convention.
  • Triggers via workflow_run after the Publish workflow completes successfully (Publish runs on version tags and pushes to PyPI), so docs deploy only after a release actually succeeds — never in parallel with it. Manual workflow_dispatch is kept for first-time/one-off deploys. The docs job checks out the released commit (workflow_run.head_sha) so the site matches the release.
  • Removes docs publishing from scripts/publish (dropped mkdocs gh-deploy --force). There was no separate "old Pages workflow" file: the previous deploy pushed the built site to the gh-pages branch, and GitHub's implicit pages-build-deployment ran off the legacy "deploy from branch" source. Switching the Pages source to GitHub Actions (below) retires that implicit workflow.

Functional equivalence

No degradation — verified by diffing rendered output against the current Material build and rendering pages in a browser:

Check Result
Pages built 8/8
API symbols (mkdocstrings) 20/20 identical
Admonitions / footnotes / collapsible details ✅ render
Code highlighting (Pygments) ✅ (now with language classes)
Cross-references (autorefs) ✅ (2 extra valid refs resolved)
Deep-purple palette + dark mode
Search ✅ (Zensical "Disco" engine)
objects.inv inventory ✅ preserved

Local checks: strict build clean, dev server (zensical serve) serves all pages, 152 tests pass at 100% coverage, lint clean.

⚠️ One-time setup on merge

  • workflow_run only fires once docs.yml is on the default branch, so the release-triggered deploy activates after this PR merges.
  • The workflow runs actions/configure-pages with enablement: true, which should switch the Pages source from the gh-pages branch to GitHub Actions on the first run. If it doesn't, set Settings → Pages → Build and deployment → Source → GitHub Actions once. The old gh-pages branch can be deleted afterward.
  • To publish docs immediately (without cutting a release), use the workflow's manual Run workflow button (workflow_dispatch).

Note (out of scope)

Issue #73 also suggests moving off httpx to httpxyz. That changes the library's runtime dependency (not just docs) and the thread concluded it's premature — deliberately left out of this PR.

🤖 Generated with Claude Code

Replaces the Material for MkDocs setup with Zensical (the successor from
the same team) and moves GitHub Pages publishing from the legacy
`mkdocs gh-deploy` branch push to a first-party GitHub Actions Pages
deployment. Addresses #73.

Docs migration
- Add zensical.toml (replacing mkdocs.yml) with equivalent nav, deep
  purple palette, light/dark toggle, and the markdown extensions the
  content uses (admonition, details, superfences, footnotes, highlight).
- mkdocstrings still auto-generates the API reference; all 20 symbols
  render identically and cross-references resolve.
- Swap the mkdocs-material dev dependency for zensical.
- scripts/build now runs `zensical build --clean --strict`.

Pages deployment
- Add .github/workflows/docs.yml: build with Zensical and deploy to
  Pages via configure-pages / upload-pages-artifact / deploy-pages on
  push to main. Actions are SHA-pinned to match repo convention.
- Drop `mkdocs gh-deploy --force` from scripts/publish; docs are no
  longer coupled to the release/tag flow.

Verified locally: strict build clean, dev server serves all pages,
rendered output matches the current site, 152 tests pass at 100%
coverage, lint clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (a7aa1f3) to head (61d8e2b).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main       #81   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            8         8           
  Lines         1460      1460           
=========================================
  Hits          1460      1460           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

will-ockmore and others added 4 commits July 6, 2026 22:27
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Add `title: API` front matter to api.md so the page heading renders
  "API" rather than the filename-derived "Api" (Zensical uses page meta
  for the title; there is no H1 in the mkdocstrings-only page).
- Add docs/stylesheets/extra.css to remove the body-link underline from
  links that wrap an image, so the home-page badge row renders cleanly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Match the previous behaviour where documentation was published as part of
the release flow. The docs workflow now triggers on the same version tags
as publish.yml (plus manual workflow_dispatch), rather than on every push
to main.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Switch the docs workflow from a tag-push trigger to workflow_run, gated
on the "Publish" workflow completing successfully. This guarantees docs
are only deployed after the PyPI release succeeds, rather than running in
parallel with it.

- Check out the released commit (workflow_run.head_sha) so the docs match
  the release rather than whatever the default branch currently points at.
- Keep workflow_dispatch for manual/first-time deploys.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@will-ockmore
will-ockmore merged commit 0db4b38 into main Jul 7, 2026
7 checks passed
@will-ockmore
will-ockmore deleted the docs-zensical-pages branch July 7, 2026 04:30
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.

httpx forks - is the library compatible?

1 participant