Skip to content

MkDocs theme: search by title, or full text with Pagefind - #2

Merged
evangress merged 2 commits into
mainfrom
mkdocs-search
Nov 11, 2026
Merged

evangress merged 2 commits into
mainfrom
mkdocs-search

Conversation

@evangress

Copy link
Copy Markdown
Contributor

Addresses two of the gaps reported for the tds-openapi docs: no search, and !!! note callouts showing as plain text.

Search

theme: search: What you get
titles (default) A search box above the sidebar that finds pages and their ## sections by title as you type. Each page carries a hidden list of every page and section, and TagAction's new search-results list filters it. No index to build, no theme script. Hidden without JavaScript.
pagefind Full-text search with Pagefind: the theme loads Pagefind's UI from pagefind/ and marks each <article> with data-pagefind-body. Run npx pagefind --site site after mkdocs build.
false No search.

Needs kovirlabs/tagaction#1 released (TagAction 0.3). With the published TagAction 0.2.0 the box appears but the results list never shows, so release TagAction first. The README says so.

Callouts

The README listed admonitions as not working. TagBrush.css 1.2.0, now on npm and served by the tagbrush@1 CDN link, styles them. They still need markdown_extensions: [admonition] in mkdocs.yml, or MkDocs leaves !!! note as text; the README now says that, and the example shows one.

Checks

  • The example builds with MkDocs 1.6.1 in strict mode (built locally with uv).
  • New test: the search box and list are in every page, hidden, with every page and section title. The existing nav test now names the Documentation nav, since TagAction also marks the current page in the results.
  • Every example page passes TagCheck; checked in a browser with the local TagAction and TagBrush.css: typing "env" leaves "Configure: Environment variables", clearing the box hides the list.
  • 57 passed, 3 skipped (Hugo builds need Hugo or Docker).

Not in this PR: loading TagBrush.css and TagAction from the site's own copies instead of the CDN, and publishing the theme to PyPI. Both are separate changes.

🤖 Generated with Claude Code

evangress and others added 2 commits November 9, 2026 21:51
- search: titles (the default) puts a search box above the sidebar.
  Each page carries a hidden list of every page and ## section, and
  TagAction's search-results list (kovirlabs/tagaction#1) filters it as
  you type: no index to build and no theme script. Hidden without
  JavaScript.
- search: pagefind loads Pagefind's search box from pagefind/ and marks
  each article for indexing; run `npx pagefind --site site` after
  `mkdocs build`.
- search: false leaves it out.

The README no longer lists callouts as missing: TagBrush.css 1.2 styles
`!!! note` once the admonition extension is on, and the example shows
one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@evangress
evangress merged commit 4d98214 into main Nov 11, 2026
1 check passed
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