Skip to content

Fix MkDocs API reference generation and navigation - #8

Merged
cursor[bot] merged 1 commit into
mainfrom
cursor/fix-mkdocs-api-docs-3a82
Jul 15, 2026
Merged

Fix MkDocs API reference generation and navigation#8
cursor[bot] merged 1 commit into
mainfrom
cursor/fix-mkdocs-api-docs-3a82

Conversation

@bdbarnett

Copy link
Copy Markdown
Contributor

Problem

The gen-files script was creating API stub pages (::: pdwidgets...), but they were not appearing in the published docs:

  1. Not in navigationmkdocs.yml had a static nav: listing only Home/Getting started/Installation/Publishing. MkDocs logged: "pages exist but are not included in nav".
  2. Broken paths — the gen script wrote reference/button.md instead of reference/pdwidgets/widgets/button/index.md, so reference/SUMMARY.md had broken links like reference/reference/widgets/button.md.

Solution

Mirrors the fix applied in PyDevices/palettes#4:

  • Removed static nav:; navigation now comes from docs/SUMMARY.md via literate-nav
  • Added API Reference → reference/ to docs/SUMMARY.md
  • Rewrote scripts/mkdocs_gen_ref_pages.py to follow the mkdocstrings recipe (index.md for packages, paths relative to src/)
  • Enabled show_root_heading / show_symbol_type_heading / show_symbol_type_toc in mkdocstrings

Verification

python3 -m mkdocs build completes without nav/link warnings. Generated pages (e.g. reference/pdwidgets/widgets/button/) include mkdocstrings API content with class and method headings.

Open in Web Open in Cursor 

The gen-files script was creating API stub pages, but static nav in
mkdocs.yml excluded them and paths used reference/foo.md instead of
reference/pdwidgets/foo/index.md, breaking reference/SUMMARY.md links.

Remove static nav in favor of literate-nav from docs/SUMMARY.md, add
API Reference section, rewrite the gen script following the mkdocstrings
recipe, and enable symbol type headings in mkdocstrings.

Co-authored-by: Brad Barnett <bdbarnett@users.noreply.github.com>
@cursor
cursor Bot marked this pull request as ready for review July 15, 2026 04:05
@cursor
cursor Bot merged commit bfbdde7 into main Jul 15, 2026
2 checks passed
@cursor
cursor Bot deleted the cursor/fix-mkdocs-api-docs-3a82 branch July 15, 2026 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants