feat: move template specializations and deduction guides off parent scope page#1199
Conversation
✨ Highlights
🧾 Changes by Scope
🔝 Top Files
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1199 +/- ##
========================================
Coverage 82.12% 82.12%
========================================
Files 33 33
Lines 3149 3149
Branches 734 734
========================================
Hits 2586 2586
Misses 387 387
Partials 176 176
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
An automated preview of the documentation is available at https://1199.mrdocs.prtest2.cppalliance.org/index.html If more commits are pushed to the pull request, the docs will rebuild at the same URL. 2026-05-19 06:59:36 UTC |
149b547 to
fb11020
Compare
…cope page Class template specializations, function template specializations, and deduction guides used to share the enclosing scope's listing with their primary template. Users have repeatedly reported this as confusing: `vector` and `vector<int>` appearing side by side in the namespace index reads as if they were independent siblings, and a primary's variants were nowhere on its own page. Specializations now appear in a dedicated "Specializations" section on the primary's documentation page, and deduction guides in a "Deduction Guides" section on the deduced class's page. The parent scope's listing carries only the primary itself. An orphan specialization (one whose primary has been excluded from extraction) stays in the parent's listing so the index can still reach it. The corpus is unchanged: XML output and consumers of the metadata schema see the same data as before. The new sections are derived in the presentation layer. Closes issue cppalliance#1154.
fb11020 to
956839a
Compare
|
This is adding exceptions to reflection. It’s reintroducing the exact problem we were fixing with reflection. It’d be easier to just store the specialization and deduction guides again in the corpus as members of the records and functions. This way, everyone has this data readily available in O(1), and the template changes are trivial. If we need exceptions to reflection, it means the data model is bad. |
|
Also, since we touched on this topic, I think we ended up forgetting about the lazy DOM object directly based on reflection. That could make things much faster. |
Class template specializations, function template specializations, and deduction guides used to share the enclosing scope's listing with their primary template. Users have repeatedly reported this as confusing:
vectorandvector<int>appearing side by side in the namespace index reads as if they were independent siblings, and a primary's variants were nowhere on its own page.Specializations now appear in a dedicated "Specializations" section on the primary's documentation page, and deduction guides in a "Deduction Guides" section on the deduced class's page. The parent scope's listing carries only the primary itself. An orphan specialization (one whose primary has been excluded from extraction) stays in the parent's listing so the index can still reach it.
The corpus is unchanged: XML output and consumers of the metadata schema see the same data as before. The new sections are derived in the presentation layer.
Closes issue #1154.
[danger skip docs].
Summary
Moves class template specializations, function template specializations, and deduction guides off the enclosing scope's listing and onto the primary template's own documentation page. Closes #1154.
Specializations and primaries used to share the enclosing scope's listing, so
vectorandvector<int>appeared side by side in the namespace index — readers reported this as confusing, since the two are not independent siblings, and the primary's own page did not mention its variants at all.After this PR:
The corpus is unchanged: XML output and consumers of the metadata schema see exactly the same data as before. The new sections are derived in the presentation layer. The diff is therefore concentrated in
src/lib/Metadata/DomCorpus.{cpp,hpp}(the derivation), a few Handlebars helpers insrc/lib/Support/Handlebars.cpp, and the Handlebars templates undershare/mrdocs/addons/that render the new sections. Two metadata headers (Function.hpp,Record.hpp) gain small additions to expose the primary-to-specialization link the derivation needs.Changes
src/lib/Metadata/DomCorpus.cpp(+159) and the publicinclude/mrdocs/Metadata/DomCorpus.hpp(+36). Supporting Handlebars helpers insrc/lib/Support/Handlebars.cpp(+54).include/mrdocs/Metadata/Symbol/Function.hpp(+28) andSymbol/Record.hpp(+14) expose the primary-to-specialization relationship the derivation reads. Templates updated undershare/mrdocs/addons/:common/partials/symbol/tranche.hbs(the per-tranche listing that no longer prints specializations alongside the primary), and the per-formatadoc/partials/symbol.adoc.hbsandhtml/partials/symbol.html.hbsrendering the new "Specializations" / "Deduction Guides" sections.test-files/golden-tests/symbols/,test-files/golden-tests/config/,test-files/golden-tests/templates/,test-files/golden-tests/javadoc/, andtest-files/golden-tests/filters/to reflect the new layout — specializations and deduction guides moved off parent listings and onto primary pages. No.xmlfixtures change, by design: the corpus is unchanged. Each updated fixture is an intentional rendering change, not a regeneration.Testing
.cppinput and asserts the resulting.html/.adocbyte-for-byte. The unchanged.xmlfixtures act as a regression guard for the architectural claim — if the corpus accidentally starts depending on the presentation change, the XML golden tests would fail.test-files/golden-tests/on every build, so the new expectations stay enforced going forward.Documentation
No user-facing documentation page is added (
[danger skip docs]). The change is a layout / discoverability improvement for the generated documentation: it does not introduce a new option, flag, or configuration knob a user would need to look up. The new "Specializations" / "Deduction Guides" sections are self-describing in the rendered output.