Repository navigation
Make mkdocs new create a Sumi site ready for AI tools, and publish a JSON Schema of mkdocs.yml - #141
Merged
Merged
Conversation
Contributor
Editors and coding agents had nothing to check mkdocs.yml against before a build. `mkdocs/config/json_schema.py` now turns the definitions of the settings in `MkDocsConfig` and of the built-in `search` and `llms_txt` plugins into a JSON Schema: types, allowed values, defaults, the docstrings as descriptions and links to the configuration guide. It is written to `docs/schema.json`, so the docs site serves it at https://mkdocs-ng.github.io/mkdocs/schema.json, and a test fails when the file is out of date. Settings of other plugins and themes are accepted without being checked; unknown top-level keys, wrong types and invalid values are reported. The tests check that the docs site's own config and every plugin compatibility case validate, and that common mistakes don't.
A new project used the 2014-era default theme and nothing more, so the first thing a new user saw was the oldest part of MkDocs, and features like `llms_txt` had to be discovered and turned on by hand. `mkdocs new` now: * uses the Sumi theme and plugin when Sumi is installed, and otherwise says how to get it; the new `sumi` extra installs both at once (`pip install "mkdocs-ng[sumi]"`); * turns on the `llms_txt` plugin; * points the YAML language server at the published JSON Schema in the first line of `mkdocs.yml`; * writes an `AGENTS.md` that tells coding agents how to build the site and write pages for it, unless the directory already has one. Existing sites don't change: the default theme of a `mkdocs.yml` without `theme` is still `mkdocs`.
shenxianpeng
force-pushed
the
claude/project-thread-z6wvzd
branch
from
November 2, 2026 07:17
f928f2e to
7ab29a4
Compare
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.
Two changes to the first minute with MkDocs NG, one commit each.
Publish a JSON Schema of mkdocs.yml.
mkdocs/config/json_schema.pyturns the setting definitions inMkDocsConfigand the built-insearchandllms_txtplugins into a JSON Schema (types, allowed values, defaults, docstrings as descriptions, links to the configuration guide). It is committed asdocs/schema.json, so the docs site serves it at https://mkdocs-ng.github.io/mkdocs/schema.json; a test fails when it is out of date (python -m mkdocs.config.json_schema > docs/schema.json). Other plugins' and themes' settings are accepted without checks. Tests validate the docs site's ownmkdocs.yml, all plugin compatibility cases incompat/cases.yaml, and reject common mistakes (typos in keys, wrong types, bad validation levels,dev_addrwithout a port, unknownllms_txtoptions). New "Editor and agent support" section in the configuration guide.mkdocs newcreates a site ready for AI tools.sumiextra:pip install "mkdocs-ng[sumi]".llms_txt.mkdocs.ymlpoints the YAML language server at the schema.AGENTS.md(commands, layout, how to write pages) unless one exists.Existing sites don't change: a
mkdocs.ymlwithoutthemestill gets themkdocstheme. The getting-started tutorial keeps the default theme (so its screenshots stay right) and has a tip about Sumi.Checked locally: a fresh
mkdocs newwith Sumi builds with--strictand writesllms.txt; the docs site builds with--strictand servesschema.json; ruff, isort and mypy are clean for the new files. The fourlocalization_testsfailures are the same onmainin my environment (Babel setup).Related Issue
Product plan item "first minute" and "agents write config correctly".
Checklist
docs/about/release-notes.mdupdated (if applicable)