Repository navigation
Unify API navigation and improve documentation discovery - #96
Conversation
PR Summary by QodoUnify API navigation and improve documentation discovery
AI Description
Diagram
High-Level Assessment
Files changed (7)
|
Code Review by Qodo
1. Documentation builds reject the API index link
|
| href = unescape(href) | ||
| if urlsplit(href).scheme or href.startswith("//") or not href.endswith(".html"): | ||
| raise ValueError(f"Expected an API page link in {source}: {href}") |
There was a problem hiding this comment.
1. Documentation builds reject the api index link 🐞 Bug ≡ Correctness
include_api_navigation() requires every anchor in the Sphinx sidebar to end in .html, including the current API index entry. When Sphinx renders that entry as href="#", the function raises ValueError before the MyST build can start.
Agent Prompt
## Issue description
`include_api_navigation()` rejects the API index's current-page `href="#"` link while extracting Sphinx's sidebar, stopping the documentation build.
## Fix Focus Areas
- docs/build_docs.py[397-409]
- tests/test_docs_render.py[1455-1462]
## Recommended Fix
Skip the current-page fragment link when extracting child API pages, or explicitly translate it to `/api/index.html`. Add a test whose sidebar includes the current-page link alongside the `.html` child links.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| {% block docs_navbar %} | ||
| <header id="pst-header" class="bd-header myst-top-nav docs-api-top-nav"> | ||
| <nav class="docs-header-placeholder"></nav> | ||
| </header> |
There was a problem hiding this comment.
2. Standalone api pages lose header navigation 🐞 Bug ≡ Correctness
layout.html replaces the Sphinx navbar with an empty docs-header-placeholder rather than a usable fallback. Running make check-reference builds the API without the later integration step, leaving those directly built pages without the header menu or search trigger.
Agent Prompt
## Issue description
The custom navbar is empty until the separate MyST integration step runs, so pages produced by the standalone Sphinx target have no header menu or search trigger.
## Fix Focus Areas
- docs/source/reference/api/_templates/layout.html[27-30]
- docs/build_docs.py[476-482]
## Recommended Fix
Render a functional Sphinx navbar as the fallback in the custom layout, and have the integration step replace that fallback with the guide header for the published site. Check both the direct Sphinx output and the integrated output.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Use the guide header and navigation throughout the Sphinx API reference while preserving API content, links and native search.
Publish API output once, exclude internal search pages from indexing, and provide consistent canonical URLs, page titles and logo preview metadata.
Validation: documentation tests, strict Sphinx and MyST builds, lint, and browser checks for navigation, themes and metadata passed.
Requires the updated shared assets from the documentation hub.