Skip to content

Send page metadata and the renderer settings of mkdocs.yml - #82

Merged
markusressel merged 1 commit into
masterfrom
page-meta
Nov 7, 2026
Merged

markusressel merged 1 commit into
masterfrom
page-meta

Conversation

@markusressel

Copy link
Copy Markdown
Member

Front matter support for the clients, requested by Android, specified in docs/page-meta.md.

Page metadata (feature page-meta)

  • Documents in the tree get meta: {title, description, icon, status, tags, searchExclude} from the YAML front matter.
  • They also get title, the page name in the MkDocs order: front matter title, else the first H1 (ATX or setext, outside fences), else the file name. For the file name, -/_ become spaces and an all-lowercase name gets a capital first letter; index/README use the folder name, and the root index is Home.
  • Pins and feed entries carry title too.
  • The tree caches the metadata by size and mtime, so a rebuild only rereads changed documents. After a live edit, the new title reaches the tree with the next tree-changed; the message itself carries nothing new.
  • No backend search: clients search the tree with these fields.

Wiki config (feature wiki-config)

  • GET /wiki/config/ returns siteName, siteUrl, useDirectoryUrls, theme {name, features, palette}, plugins, markdownExtensions and extraCss. Lists are normalized from all MkDocs forms; without a plugins key the result is search alone.
  • No secrets: !ENV values and keys that look like secrets (*token, *secret, *password, *apikey, key, auth, ...) are dropped at any depth, and nothing outside these keys is sent.
  • !!python/name:x becomes x.

Live wiki

  • 64 pages; only index.md has front matter (title: Home), none uses MultiMarkdown meta. So the backend reads YAML front matter only.
  • The live mkdocs.yml has no plugins key, so the default search applies.

Note

The existing GET /mkdocs/config/ still returns the whole mkdocs.yml unfiltered to every authenticated account. I left it unchanged. Restricting or removing it is a separate decision.

Tests

  • internal/wiki: front matter forms (BOM, CRLF, ..., invalid YAML), title rules, tree cache refresh. Also the config with the live wiki's form plus secrets, !ENV, python tags, mapping plugins and defaults.
  • internal/api: tree, a live edit reaching the title, pin and feed titles, /wiki/config/.

🤖 Generated with Claude Code

Documents in the tree get the front matter fields the clients show
(title, description, icon, status, tags, search.exclude) and the page
name as MkDocs derives it. Pins and feed entries get the title too.
GET /wiki/config/ returns theme, plugins and Markdown extensions without
secrets. Features "page-meta" and "wiki-config", see docs/page-meta.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@markusressel
markusressel merged commit 7b1d0b7 into master Nov 7, 2026
13 checks passed
@markusressel
markusressel deleted the page-meta branch November 7, 2026 13:27
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