Skip to content

docs: compile every documentation code block#326

Merged
sgerbino merged 1 commit into
cppalliance:developfrom
sgerbino:pr/compiled-examples
Jul 24, 2026
Merged

docs: compile every documentation code block#326
sgerbino merged 1 commit into
cppalliance:developfrom
sgerbino:pr/compiled-examples

Conversation

@sgerbino

Copy link
Copy Markdown
Collaborator

Replace all ~375 hand-typed [source,cpp] blocks across the 30 doc pages with includes of compiled sources, mirroring Boost.Capy, so an example that breaks can no longer render on the site.

  • test/doc/snippets: one TU per page; fragments compile and run as test suites, exercising loopback socket pairs, ephemeral ports, in-process signals, real timers, temp-path file I/O, and genuine error paths (connection refused, FIN, RST, cancellation, timeout)
  • test/doc/programs: complete programs; servers that would run forever are compiled and linked but not executed (run_examples.py covers the real examples' runtime behavior)
  • tutorial pages excerpt the canonical example programs via tag regions; tls_context_examples.cpp joins the example build so its excerpts cannot rot
  • page preambles ("Code snippets assume") render from the tagged tops of the TUs that compile them, so stated assumptions stay honest
  • @antora/collector-extension, registered in the library's own playbook, scans example/ and test/doc into the Antora examples family; pages use include::example$...[tag=...]
  • blocks that intentionally do not compile are explicit: role=pseudocode (6) and role=external (2)
  • snippet_check.py is retired: extraction-based checking is obsolete when the docs render from sources the test suite compiles and runs

Replace all ~375 hand-typed [source,cpp] blocks across the 30 doc
pages with includes of compiled sources, mirroring Boost.Capy, so an
example that breaks can no longer render on the site.

- test/doc/snippets: one TU per page; fragments compile and run as
  test suites, exercising loopback socket pairs, ephemeral ports,
  in-process signals, real timers, temp-path file I/O, and genuine
  error paths (connection refused, FIN, RST, cancellation, timeout)
- test/doc/programs: complete programs; servers that would run
  forever are compiled and linked but not executed (run_examples.py
  covers the real examples' runtime behavior)
- tutorial pages excerpt the canonical example programs via tag
  regions; tls_context_examples.cpp joins the example build so its
  excerpts cannot rot
- page preambles ("Code snippets assume") render from the tagged
  tops of the TUs that compile them, so stated assumptions stay
  honest
- @antora/collector-extension, registered in the library's own
  playbook, scans example/ and test/doc into the Antora examples
  family; pages use include::example$...[tag=...]
- blocks that intentionally do not compile are explicit:
  role=pseudocode (6) and role=external (2)
- snippet_check.py is retired: extraction-based checking is obsolete
  when the docs render from sources the test suite compiles and runs
@cppalliance-bot

Copy link
Copy Markdown

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

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

2026-07-24 13:24:48 UTC

@cppalliance-bot

Copy link
Copy Markdown

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

Build time: 2026-07-24 13:38:47 UTC

@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.47%. Comparing base (953f592) to head (6bcaf93).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #326   +/-   ##
========================================
  Coverage    77.47%   77.47%           
========================================
  Files           96       96           
  Lines         6868     6868           
  Branches      1652     1652           
========================================
  Hits          5321     5321           
  Misses        1055     1055           
  Partials       492      492           

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 953f592...6bcaf93. Read the comment docs.

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

@sgerbino
sgerbino merged commit 1824845 into cppalliance:develop Jul 24, 2026
45 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Beast2 Jul 24, 2026
@sgerbino
sgerbino deleted the pr/compiled-examples branch July 24, 2026 15:46
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.

2 participants