Skip to content

refactor: common symbol template#1225

Merged
alandefreitas merged 2 commits into
cppalliance:developfrom
alandefreitas:develop
Jun 10, 2026
Merged

refactor: common symbol template#1225
alandefreitas merged 2 commits into
cppalliance:developfrom
alandefreitas:develop

Conversation

@alandefreitas

Copy link
Copy Markdown
Collaborator

The symbol page used to live as two big format-specific templates (adoc, html) that drifted apart and had to be kept in sync by hand. This happened because the table partial wasn't easy to abstract. We wrote a data-level template partial and symbol.hbs now lives as one common template for all format. This also allowed the Markdown and TeX example generators from the documentation to collapse from hundreds of lines of per-format markup to a small set of primitives plus a wrapper, so they read like a good demo of how easy a new data-driven generator should be.

Changes

  • Source (handlebars templates): one common symbol.hbs plus per-section partials and per-format markup primitives, replacing the two symbol.{adoc,html}.hbs templates. A few small divergences across formats were also aligned as part of the same change.
  • Golden tests: regenerated for the intentional structural diffs.
  • Build: latex as renamed to tex (that's the appropriate filename), so now CMakeLists.txt lists tex (instead of latex) alongside md and jsonl.

Testing

mrdocs-test-test-fixtures-all already covers all formats; goldens were regenerated only after reviewing each diff.

Documentation

The generators index gained a "More formats as extensions" section pointing at the md, tex, and jsonl starters under examples/.

@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown

✨ Highlights

  • 🧪 Existing golden tests changed (behavior likely shifted)

🧾 Changes by Scope

Scope Lines Δ% Lines Δ Lines + Lines - Files Δ Files + Files ~ Files ↔ Files -
🥇 Golden Tests 97% 91814 36504 55310 602 - 602 - -
🛠️ Source 1% 1211 507 704 50 30 7 - 13
📚 Examples 1% 1096 151 945 40 18 4 9 9
📄 Docs <1% 47 27 20 2 - 2 - -
🏗️ Build <1% 2 1 1 1 - 1 - -
⚙️ CI <1% 1 1 - 1 - 1 - -
Total 100% 94171 37191 56980 696 48 617 9 22

Legend: Files + (added), Files ~ (modified), Files ↔ (renamed), Files - (removed)

🔝 Top Files

  • test-files/golden-tests/symbols/record/class-template-specializations-1.html (Golden Tests): 13551 lines Δ (+5174 / -8377)
  • test-files/golden-tests/symbols/variable/function-objects.html (Golden Tests): 1992 lines Δ (+806 / -1186)
  • test-files/golden-tests/symbols/record/class-template-specializations-3.html (Golden Tests): 1717 lines Δ (+679 / -1038)

Generated by 🚫 dangerJS against 469204d

@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.97%. Comparing base (1fc8a77) to head (bc82074).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1225   +/-   ##
========================================
  Coverage    81.97%   81.97%           
========================================
  Files           34       34           
  Lines         3179     3179           
  Branches       743      743           
========================================
  Hits          2606     2606           
  Misses         392      392           
  Partials       181      181           
Flag Coverage Δ
bootstrap 81.97% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4c720f4f30

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread share/mrdocs/addons/generator/common/partials/symbol/section/return-value.hbs Outdated
@cppalliance-bot

cppalliance-bot commented Jun 10, 2026

Copy link
Copy Markdown

An automated preview of the documentation is available at https://1225.mrdocs.prtest2.cppalliance.org/index.html

If more commits are pushed to the pull request, the docs will rebuild at the same URL.

2026-06-10 15:35:25 UTC

Make tables render from data. `markup/table` takes `headers`, `items`,
and `columns`. Cells use the `markup/cell` partial. With this, we move the symbol page out of the per-format adoc and html templates
and into a single `common/partials/symbol.hbs`.

This makes generators impossible to drift at the symbol level and data-driven generators much easier to write because they don't have to redefine the symbol template.
The symbol page now lives in a single common template, so the
data-driven examples no longer need their own `symbol.<id>.hbs`.
Each example is just a handful of format-specific markup primitives
(table, section, admonition, list items, paragraph, heading, brief)
plus the layout wrappers. Everything else comes from common and html.
@alandefreitas alandefreitas merged commit b28ba4b into cppalliance:develop Jun 10, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants