Skip to content

Add opinionated MkDocs + GitHub Pages docs tooling to template - #110

Open
thibaudcolas wants to merge 1 commit into
mainfrom
mkdocs-docs-tooling
Open

Add opinionated MkDocs + GitHub Pages docs tooling to template#110
thibaudcolas wants to merge 1 commit into
mainfrom
mkdocs-docs-tooling

Conversation

@thibaudcolas

Copy link
Copy Markdown
Member

Summary

Adds an opinionated documentation setup to the template, replicating the tooling from draftjs_exporter: MkDocs + Material for MkDocs + mkdocstrings, published to GitHub Pages.

Docs tooling:

  • mkdocs.yml — Material theme, markdown extensions, mkdocstrings wired to src/ so the API reference is generated from docstrings, and mkdocs-llmstxt generating llms.txt / llms-full.txt.
  • docs/ — index, getting started, usage, API + configuration reference, agent skills page, and contributing/documentation.md documenting the tooling evaluation (Sphinx vs Zensical vs MkDocs; Read the Docs vs GitHub Pages) against the agreed criteria (ease of use, docstring support, deployment fit, maturity).
  • just docs-build (--strict) and just docs-serve recipes; CI builds docs strictly and deploys to GitHub Pages on pushes to main via actions/deploy-pages.

Agent skills scaffolding:

  • Demo placeholder skill at src/my_project_name/.agents/skills/my-project-name/SKILL.md, with its description wired to the short-description placeholder.
  • docs/hooks.pyon_post_build hook copying skills into .well-known/agent-skills/ and generating index.json + ai-catalog.json discovery catalogs. Host metadata (did:web, URN authority, URLs) is derived from site_url at build time, so it is correct in both the template and generated packages.
  • include-hidden-files: true on the Pages upload so the .well-known/ files deploy.

Template mechanics:

  • Derived __project_site_url / __project_org cookiecutter variables so the Pages URL resolves in generated packages; kebab-case placeholder directories renamed by the pre-prompt hook.
  • docs/theme added to _copy_without_render so cookiecutter leaves the MkDocs Jinja override untouched.

Review fixes folded in (found while verifying this PR):

  • The pre-prompt hook now also skips top-level git-ignored directories and root .agents/ when building the generated project. Previously, running cookiecutter . from any working checkout copied .venv/site/node_modules into the generated package — raw Jinja templates inside .venv then broke rendering with a cryptic TemplateSyntaxError — and the template's own authoring skills leaked into generated packages. Untracked (non-ignored) content is still copied, and there is a static fallback when git is unavailable (zip downloads).
  • /site (docs build output) added to .stylelintignore / .prettierignore, so just lint keeps passing after running just docs-build.
  • uv.lock regenerated on top of latest main (Python 3.10 drop, uv_build bump, lock maintenance), and docs/hooks.py updated for the newer Ruff (datetime.UTC).

Verification

  • just lint, just docs-build (strict, 0 warnings), and pytest tests pass in this repo; just test's only failure is pytest collecting the untracked local/draftjs_exporter reference copy in this workspace (never present in CI).
  • Generated a package with cookiecutter . --no-input from both a clean clone and a working checkout: placeholders resolve, exactly one demo skill is scaffolded at src/wagtail_cool_project/.agents/skills/wagtail-cool-project/, mkdocs build --strict passes, and the built site publishes correct .well-known/agent-skills/index.json, .well-known/ai-catalog.json and llms.txt (host did:web:org-name-or-username.github.io:wagtail-cool-project, description pulled from the cookiecutter variable).
  • Ruff clean in both the template and the generated package.

- MkDocs + Material + mkdocstrings (API reference from docstrings)
- llms.txt / llms-full.txt generation via mkdocs-llmstxt
- Agent skills scaffolding: demo placeholder skill, docs/hooks.py
  publishing .well-known/agent-skills/ + ai-catalog.json discovery
  catalogs, with host metadata derived from site_url at build time
- just docs-build / docs-serve recipes, CI docs build + Pages deploy
- cookiecutter placeholders for site URL and kebab-case dirs
- Evaluation of Sphinx/Zensical/mkdocs and Pages/RTD documented in
  docs/contributing/documentation.md
@zerolab

zerolab commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Why go for mkdocs instead of zensical when mkdocs v1.x is no longer maintained and v2 going in quite a different direction making it difficult to work with plugins from what I understand?

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