Add opinionated MkDocs + GitHub Pages docs tooling to template - #110
Open
thibaudcolas wants to merge 1 commit into
Open
Add opinionated MkDocs + GitHub Pages docs tooling to template#110thibaudcolas wants to merge 1 commit into
thibaudcolas wants to merge 1 commit into
Conversation
- 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
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? |
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.
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,mkdocstringswired tosrc/so the API reference is generated from docstrings, andmkdocs-llmstxtgeneratingllms.txt/llms-full.txt.docs/— index, getting started, usage, API + configuration reference, agent skills page, andcontributing/documentation.mddocumenting 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) andjust docs-serverecipes; CI builds docs strictly and deploys to GitHub Pages on pushes tomainviaactions/deploy-pages.Agent skills scaffolding:
src/my_project_name/.agents/skills/my-project-name/SKILL.md, with its description wired to the short-description placeholder.docs/hooks.py—on_post_buildhook copying skills into.well-known/agent-skills/and generatingindex.json+ai-catalog.jsondiscovery catalogs. Host metadata (did:web, URN authority, URLs) is derived fromsite_urlat build time, so it is correct in both the template and generated packages.include-hidden-files: trueon the Pages upload so the.well-known/files deploy.Template mechanics:
__project_site_url/__project_orgcookiecutter variables so the Pages URL resolves in generated packages; kebab-case placeholder directories renamed by the pre-prompt hook.docs/themeadded to_copy_without_renderso cookiecutter leaves the MkDocs Jinja override untouched.Review fixes folded in (found while verifying this PR):
.agents/when building the generated project. Previously, runningcookiecutter .from any working checkout copied.venv/site/node_modulesinto the generated package — raw Jinja templates inside.venvthen broke rendering with a crypticTemplateSyntaxError— 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, sojust lintkeeps passing after runningjust docs-build.uv.lockregenerated on top of latestmain(Python 3.10 drop, uv_build bump, lock maintenance), anddocs/hooks.pyupdated for the newer Ruff (datetime.UTC).Verification
just lint,just docs-build(strict, 0 warnings), andpytest testspass in this repo;just test's only failure is pytest collecting the untrackedlocal/draftjs_exporterreference copy in this workspace (never present in CI).cookiecutter . --no-inputfrom both a clean clone and a working checkout: placeholders resolve, exactly one demo skill is scaffolded atsrc/wagtail_cool_project/.agents/skills/wagtail-cool-project/,mkdocs build --strictpasses, and the built site publishes correct.well-known/agent-skills/index.json,.well-known/ai-catalog.jsonandllms.txt(hostdid:web:org-name-or-username.github.io:wagtail-cool-project, description pulled from the cookiecutter variable).