Skip to content

Make mkdocs new create a Sumi site ready for AI tools, and publish a JSON Schema of mkdocs.yml - #141

Merged
shenxianpeng merged 2 commits into
mainfrom
claude/project-thread-z6wvzd
Nov 2, 2026
Merged

shenxianpeng merged 2 commits into
mainfrom
claude/project-thread-z6wvzd

Conversation

@shenxianpeng

@shenxianpeng shenxianpeng commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Two changes to the first minute with MkDocs NG, one commit each.

Publish a JSON Schema of mkdocs.yml. mkdocs/config/json_schema.py turns the setting definitions in MkDocsConfig and the built-in search and llms_txt plugins into a JSON Schema (types, allowed values, defaults, docstrings as descriptions, links to the configuration guide). It is committed as docs/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 own mkdocs.yml, all plugin compatibility cases in compat/cases.yaml, and reject common mistakes (typos in keys, wrong types, bad validation levels, dev_addr without a port, unknown llms_txt options). New "Editor and agent support" section in the configuration guide.

mkdocs new creates a site ready for AI tools.

  • Uses the Sumi theme and plugin when Sumi is installed; otherwise logs how to get it. New sumi extra: pip install "mkdocs-ng[sumi]".
  • Turns on llms_txt.
  • First line of mkdocs.yml points the YAML language server at the schema.
  • Writes AGENTS.md (commands, layout, how to write pages) unless one exists.

Existing sites don't change: a mkdocs.yml without theme still gets the mkdocs theme. The getting-started tutorial keeps the default theme (so its screenshots stay right) and has a tip about Sumi.

Checked locally: a fresh mkdocs new with Sumi builds with --strict and writes llms.txt; the docs site builds with --strict and serves schema.json; ruff, isort and mypy are clean for the new files. The four localization_tests failures are the same on main in my environment (Babel setup).

Related Issue

Product plan item "first minute" and "agents write config correctly".

Checklist

  • New tests added for new behavior (if applicable)
  • Documentation updated (if applicable)
  • Release notes docs/about/release-notes.md updated (if applicable)

@shenxianpeng shenxianpeng self-assigned this Nov 2, 2026
@codspeed

codspeed Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 29 untouched benchmarks


Comparing claude/project-thread-z6wvzd (7ab29a4) with main (0a5eb1f)

Open in CodSpeed

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
shenxianpeng force-pushed the claude/project-thread-z6wvzd branch from f928f2e to 7ab29a4 Compare November 2, 2026 07:17
@shenxianpeng
shenxianpeng merged commit de98379 into main Nov 2, 2026
23 checks passed
@shenxianpeng
shenxianpeng deleted the claude/project-thread-z6wvzd branch November 2, 2026 07:18
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.

1 participant