Skip to content

docs: source duplicated reference snippets from the library itself - #388

Merged
mvandeberg merged 1 commit into
cppalliance:developfrom
mvandeberg:pr/doc-snippets-from-library
Aug 27, 2026
Merged

docs: source duplicated reference snippets from the library itself#388
mvandeberg merged 1 commit into
cppalliance:developfrom
mvandeberg:pr/doc-snippets-from-library

Conversation

@mvandeberg

Copy link
Copy Markdown
Contributor

Several pages showed a library definition by keeping a hand-maintained copy of it in a snippet translation unit, free to drift from what ships -- and it had: #383 changed IoAwaitable while both copies still showed the older one-requirement version. Closes #381.

Six definitions now carry tag::/end:: markers in their headers: Executor, ReadStream, WriteStream, IoRunnable, the two buffer sequence concepts and safe_resume. An antora.yml collector entry scans those headers into the examples tree, and ten include:: directives target the header instead of the snippet, so a page can no longer show a definition the library does not have.

IoAwaitable is left out deliberately. #383 replaced both of its code blocks with prose, so no page shows the concept and a marker would have no consumer.

Each copy sat in a definition/concept_sketch namespace beside a pair of static_asserts, one against the copy and one against the real concept, under a comment claiming the two must match. The pair never established that: both hold whenever a single type satisfies both concepts, however far apart the definitions have drifted. The copies and the comments are gone, the asserts against the real concepts stay, and seven includes left unused by the deletions are removed.

9n's abbreviated WriteStream is replaced by the whole concept rather than pinned to it. A nested tag could only mark the opening lines; the elision marker and closing brace are not in the header, so the page would have to supply them as literal text, which doc-lint's B2 rule forbids. Showing all of it also serves the argument, since the page contrasts Capy's concept with Cobalt's concrete parameter and hiding half of Capy's requirements understates what the concept asks of a type.

doc/lint/check-include-tags.mjs is new and blocking. Sourcing from headers removes the drift but leaves a quieter failure: Asciidoctor treats a missing include tag as a warning and exits 0, rendering an empty block, and the Antora CI leg only asserts that build/site exists because Antora also exits 0 on failure. A marker deleted during refactoring would empty a page with nothing going red. The check resolves every include::example$ directive through antora.yml's own scan config and fails on an unresolved file or a missing tag, across all 355 tagged includes rather than only the ten moved here. It stays outside the baseline/comparator posture the other lint steps share: it is a structural check, not a style rule with a backlog to burn down, and it stands at zero violations.

The markers sit on their own line after the closing */ because MrDocs passes -fparse-all-comments, which merges a comment adjacent to a docstring into it.

Several pages showed a library definition by keeping a hand-maintained copy
of it in a snippet translation unit, free to drift from what ships -- and it
had: cppalliance#383 changed IoAwaitable while both copies still showed the older
one-requirement version. Closes cppalliance#381.

Six definitions now carry tag::/end:: markers in their headers: Executor,
ReadStream, WriteStream, IoRunnable, the two buffer sequence concepts and
safe_resume. An antora.yml collector entry scans those headers into the
examples tree, and ten include:: directives target the header instead of the
snippet, so a page can no longer show a definition the library does not have.

IoAwaitable is left out deliberately. cppalliance#383 replaced both of its code blocks
with prose, so no page shows the concept and a marker would have no consumer.

Each copy sat in a definition/concept_sketch namespace beside a pair of
static_asserts, one against the copy and one against the real concept, under
a comment claiming the two must match. The pair never established that: both
hold whenever a single type satisfies both concepts, however far apart the
definitions have drifted. The copies and the comments are gone, the asserts
against the real concepts stay, and seven includes left unused by the
deletions are removed.

9n's abbreviated WriteStream is replaced by the whole concept rather than
pinned to it. A nested tag could only mark the opening lines; the elision
marker and closing brace are not in the header, so the page would have to
supply them as literal text, which doc-lint's B2 rule forbids. Showing all of
it also serves the argument, since the page contrasts Capy's concept with
Cobalt's concrete parameter and hiding half of Capy's requirements
understates what the concept asks of a type.

doc/lint/check-include-tags.mjs is new and blocking. Sourcing from headers
removes the drift but leaves a quieter failure: Asciidoctor treats a missing
include tag as a warning and exits 0, rendering an empty block, and the
Antora CI leg only asserts that build/site exists because Antora also exits 0
on failure. A marker deleted during refactoring would empty a page with
nothing going red. The check resolves every include::example$ directive
through antora.yml's own scan config and fails on an unresolved file or a
missing tag, across all 355 tagged includes rather than only the ten moved
here. It stays outside the baseline/comparator posture the other lint steps
share: it is a structural check, not a style rule with a backlog to burn
down, and it stands at zero violations.

The markers sit on their own line after the closing */ because MrDocs passes
-fparse-all-comments, which merges a comment adjacent to a docstring into it.
@cppalliance-bot

Copy link
Copy Markdown

An automated preview of the documentation is available at https://388.capy.prtest3.cppalliance.org/index.html

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

2026-08-26 18:53:12 UTC

@codecov

codecov Bot commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.09%. Comparing base (7b3062d) to head (972bd51).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #388      +/-   ##
===========================================
- Coverage    98.12%   98.09%   -0.04%     
===========================================
  Files           65      130      +65     
  Lines         3314     6291    +2977     
===========================================
+ Hits          3252     6171    +2919     
- Misses          62      120      +58     
Flag Coverage Δ
linux 98.08% <ø> (?)

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

Files with missing lines Coverage Δ
include/boost/capy/buffers.hpp 100.00% <ø> (ø)
include/boost/capy/ex/frame_allocator.hpp 100.00% <ø> (ø)

... and 66 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7b3062d...972bd51. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cppalliance-bot

Copy link
Copy Markdown

GCOVR code coverage report https://388.capy.prtest3.cppalliance.org/gcovr/index.html
LCOV code coverage report https://388.capy.prtest3.cppalliance.org/genhtml/index.html
Coverage Diff Report https://388.capy.prtest3.cppalliance.org/diff-report/index.html

Build time: 2026-08-26 19:08:38 UTC

@mvandeberg
mvandeberg merged commit 44f55b1 into cppalliance:develop Aug 27, 2026
143 of 144 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Beast2 Aug 27, 2026
@mvandeberg
mvandeberg deleted the pr/doc-snippets-from-library branch August 27, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Use library for reference snippets

2 participants