QDoc: Add navigation data types and heading anchor enrichment
Documentation readers navigating between related pages need breadcrumbs,
sequential links, and a sidebar table of contents. The template
generator's IR pipeline currently has no types to carry this navigation
metadata from extraction through rendering.
NavigationData captures the driver-side extraction results — breadcrumb
chain, prev/next/start links, TOC entries, and TOC depth — while
NavigationInfo is the frozen IR value type that templates consume via
toJson(). Each breadcrumb carries a CrumbState discriminator so the
template can distinguish a resolvable link, the current page, and an
unresolvable ancestor without conflating the last two through an empty
href. TOC entries are a flat ordered list of heading titles, anchor
identifiers, and levels, so templates can filter or group at render
time according to the presentation they want. ContentBuilder now reads
heading anchor identifiers from atom refs during section processing,
enabling TOC links to target the correct headings. Thirteen Catch2
scenarios validate serialization, breadcrumb state variants, TOC entry
serialization, and sectionRef enrichment correctness.
Task-number: QTBUG-145915
Change-Id: Ic9939f894c3fc1c652afc71011f5a8282711e4ef
Reviewed-by: Topi Reinio <topi.reinio@qt.io>
| commit | 449b27b0546d04860b578bf14438ca1b6920749c |
| parent | 73c603c634eb8f75cc4f77243d40f239e8a1e730 |
| author | Paul Wicking <paul.wicking@qt.io> |
| committer | Paul Wicking <paul.wicking@qt.io> |
| commit time | Wed, 22 Apr 2026 07:48:03 +0000 |
- M src/qdoc/qdoc/src/qdoc/ir/contentbuilder.cpp
- M src/qdoc/qdoc/src/qdoc/ir/document.cpp
- M src/qdoc/qdoc/src/qdoc/ir/document.h
- M src/qdoc/qdoc/src/qdoc/ir/pagemetadata.h
- M src/qdoc/qdoc/tests/qdoc/ir/catch_contentbuilder.cpp
- M src/qdoc/qdoc/tests/qdoc/ir/catch_document.cpp
- 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/qtlottie_validation/expected/html/lottietoqml.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/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