QDoc: Add navigation chrome to page templates
Pages rendered by the template generator arrive without navigation
chrome. Readers have no breadcrumb trail back to higher-level index
pages, no sidebar table of contents to jump within a page, and no
prev or next links to navigate a curated sequence. Structural
headings that the page templates emit — such as "Public Functions",
"Detailed Description", and "Member Function Documentation" — carry
no anchor identifiers, so even authored links targeting those
landmarks cannot resolve to them.
The navigation partial renders the breadcrumb trail with a
three-way branch on the crumb state: resolved ancestors render as
links, the current page renders as an aria-current marker, and
unresolvable ancestors render as plain text so a missing target no
longer masquerades as the current page. The sidebar TOC iterates
the ordered list of entries assembled in the IR, so the structural
h2s emitted by the page templates appear alongside body
section-headings in reading order. The HTML head now carries
prev/next/start link relations for assistive technology and
browser navigation UIs; the HTML footer renders prev and next
links visually, the Markdown footer renders them as a paired line.
Structural h2s across the cppref, QML type, and generic page
templates now carry id attributes matching the anchors the IR
emits, so every TOC entry lands on a real target. Markdown
reference pages mirror the HTML's "Detailed Description" divider
when body content is present, and the TOC inclusion logic in the
IR Builder extends to QML type pages so the divider appears in the
TOC wherever it renders in the body. Href values in HTML chrome
partials are HTML-escaped for consistency with the rest of the
templates. Markdown pages with a single current or unresolvable
crumb suppress the breadcrumb line entirely, since a bare text
line above the page title reads as stray content rather than
chrome.
Task-number: QTBUG-145915
Change-Id: Id88ebe65913191b5569cec4241f4ab3c3a53a1e5
Reviewed-by: Topi Reinio <topi.reinio@qt.io>
| commit | af18d8f9568878502c29a649dbc806ee877b563c |
| parent | 584ee9064db218bf3fe3406c773aa62bdf38cff2 |
| author | Paul Wicking <paul.wicking@qt.io> |
| committer | Paul Wicking <paul.wicking@qt.io> |
| commit time | Wed, 22 Apr 2026 07:48:09 +0000 |
- M src/qdoc/qdoc/CMakeLists.txt
- M src/qdoc/qdoc/src/qdoc/ir/builder.cpp
- M src/qdoc/qdoc/src/qdoc/templates/collection.html
- M src/qdoc/qdoc/src/qdoc/templates/collection.md
- M src/qdoc/qdoc/src/qdoc/templates/cppref.html
- M src/qdoc/qdoc/src/qdoc/templates/cppref.md
- M src/qdoc/qdoc/src/qdoc/templates/members.html
- M src/qdoc/qdoc/src/qdoc/templates/members.md
- M src/qdoc/qdoc/src/qdoc/templates/obsolete.html
- M src/qdoc/qdoc/src/qdoc/templates/obsolete.md
- M src/qdoc/qdoc/src/qdoc/templates/page.html
- M src/qdoc/qdoc/src/qdoc/templates/page.md
- M src/qdoc/qdoc/src/qdoc/templates/partials/html/footer.html
- M src/qdoc/qdoc/src/qdoc/templates/partials/html/head.html
- A src/qdoc/qdoc/src/qdoc/templates/partials/html/nav.html
- M src/qdoc/qdoc/src/qdoc/templates/partials/md/footer.md
- A src/qdoc/qdoc/src/qdoc/templates/partials/md/nav.md
- M src/qdoc/qdoc/src/qdoc/templates/qmltype.html
- M src/qdoc/qdoc/src/qdoc/templates/qmltype.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/html/qcoapclient.html
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/html/qcoapmessage.html
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/html/qcoapoption.html
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/html/qcoapprivatekey.html
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/html/qcoapreply.html
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/html/qcoaprequest.html
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/html/qcoapresource.html
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/html/qcoapresourcediscoveryreply.html
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/html/qcoapsecurityconfiguration.html
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/html/qtcoap-index.html
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/html/qtcoap-overview.html
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/html/qtcoap-quickmulticastclient-example.html
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/html/qtcoap-quicksecureclient-example.html
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/html/qtcoap-simplecoapclient-example.html
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/html/qtcoap.html
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/markdown/qcoapclient-members.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/markdown/qcoapclient.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/markdown/qcoapmessage-members.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/markdown/qcoapmessage.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/markdown/qcoapoption-members.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/markdown/qcoapoption.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/markdown/qcoapprivatekey-members.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/markdown/qcoapprivatekey.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/markdown/qcoapreply-members.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/markdown/qcoapreply.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/markdown/qcoaprequest-members.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/markdown/qcoaprequest.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/markdown/qcoapresource-members.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/markdown/qcoapresource.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/markdown/qcoapresourcediscoveryreply-members.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/markdown/qcoapresourcediscoveryreply.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/markdown/qcoapsecurityconfiguration-members.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/markdown/qcoapsecurityconfiguration.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/markdown/qtcoap-examples.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/markdown/qtcoap-index.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/markdown/qtcoap-module.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/markdown/qtcoap-overview.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/markdown/qtcoap-quickmulticastclient-example.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/markdown/qtcoap-quicksecureclient-example.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/markdown/qtcoap-simplecoapclient-example.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/markdown/qtcoap.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/cppref_validation/expected/markdown/threads-reentrancy.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/dual_format_output/expected/markdown/readme.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/markdown_output/expected/template/readme.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qtlottie_validation/expected/html/lottietoqml.html
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qtlottie_validation/expected/html/qml-item.html
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qtlottie_validation/expected/html/qml-qt-labs-lottieqt-lottieanimation.html
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qtlottie_validation/expected/html/qml-qt-labs-lottieqt-vectorimagehelpers-layeritem.html
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qtlottie_validation/expected/html/qt-labs-lottieqt-qmlmodule.html
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qtlottie_validation/expected/html/qt-labs-lottieqt-vectorimagehelpers-qmlmodule.html
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qtlottie_validation/expected/html/qt-target-qml-from-lottie.html
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qtlottie_validation/expected/html/qtlottie-lottietoqml-example.html
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qtlottie_validation/expected/html/qtlottie-qtlottieviewer-example.html
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qtlottie_validation/expected/html/qtlottieanimation-index.html
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qtlottie_validation/expected/markdown/lottietoqml.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qtlottie_validation/expected/markdown/qml-item.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qtlottie_validation/expected/markdown/qml-qt-labs-lottieqt-lottieanimation-members.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qtlottie_validation/expected/markdown/qml-qt-labs-lottieqt-lottieanimation.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qtlottie_validation/expected/markdown/qml-qt-labs-lottieqt-vectorimagehelpers-layeritem-members.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qtlottie_validation/expected/markdown/qml-qt-labs-lottieqt-vectorimagehelpers-layeritem.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qtlottie_validation/expected/markdown/qt-labs-lottieqt-qmlmodule.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qtlottie_validation/expected/markdown/qt-labs-lottieqt-vectorimagehelpers-qmlmodule.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qtlottie_validation/expected/markdown/qt-target-qml-from-lottie.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qtlottie_validation/expected/markdown/qtlottie-lottietoqml-example.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qtlottie_validation/expected/markdown/qtlottie-qtlottieviewer-example.md
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qtlottie_validation/expected/markdown/qtlottieanimation-index.md