Skip to content

Document how to build, name the C++26 entry point, and fix the docs-site alerts - #395

Merged
Bronek merged 12 commits into
mainfrom
bronek/update_CONTRIBUTING_README_znai_docs
Aug 2, 2026
Merged

Document how to build, name the C++26 entry point, and fix the docs-site alerts#395
Bronek merged 12 commits into
mainfrom
bronek/update_CONTRIBUTING_README_znai_docs

Conversation

@Bronek

@Bronek Bronek commented Aug 1, 2026

Copy link
Copy Markdown
Member

Three documentation changes for the 0.1 release, one per commit.

Show how to configure each build. CONTRIBUTING.md described the CMake options in prose but gave no cmake invocation anywhere — the only runnable line in ## Building locally compiled a single example with g++. It now opens with the default configure, build and ctest, and carries a section each for the C++23 and C++26 modes, sanitizers, coverage and the documentation build, with the requirements that are easy to get wrong: gcovr 8.4 or newer and a coverage tool matching the compiler; Doxygen 1.12.0, znai 1.91 and Graphviz for the docs; and the platforms where sanitizers are refused outright.

Name the C++26 entry point. README.md named only libfn::fn and libfn::pfn, leaving libfn::fn_cxx26 undocumented for consumers. It now states the rule — link exactly one entry point per target — and what each way of getting it wrong looks like: the #error naming __cpp_lib_type_order, and the undefined reference whose type names differ by the _cxx26 ABI namespace. Part of #352.

This commit also drops README's claim that libfn suits asynchronous composition. Nothing in the repository backed it, and the paragraph's one substantiated sentence is already made where callables as values are discussed. #393 tracks earning the claim back with an example.

Render GitHub's alerts as znai attention blocks. TYPE_ALGEBRA's fourteen > [!NOTE] / > [!TIP] / > [!WARNING] alerts reached the documentation site as plain blockquotes, each opening with a literal [!NOTE] line. scripts/stage_docs_source.py now converts them: the quoting comes off before the existing rewrites, so a heading or link inside an alert is treated like any other, and the block is fenced afterwards, longer than any fence it contains.

znai builds an attention block for a fixed set of types and turns anything else into a code snippet that prints the markdown verbatim — which is how a first attempt using attention-tip produced a green build and a broken page. An unmapped alert kind now fails the staging instead. [!TIP] maps to a note block, there being no tip type; #394 covers giving the mathematical asides their own styling.

Verification

The full documentation pipeline was run locally on this tree: export_docs exits 0 through all six steps, including docs_check_coverage and docs_check_signatures. All fourteen alerts convert, no literal GFM marker survives anywhere on the generated site, no BlockQuote node remains, and the nested cpp excerpt on the identity-cluster page still renders as a code snippet inside its attention block.

On tests

No test accompanies the staging-script change. Testing the generated site would mean asserting against znai's output — a harness, a fixture format and a dependency aimed at the documentation toolchain rather than at the library's semantics, which is not a burden this project should take on. znai turns an unrecognised attention type into a code snippet without failing, so export_docs was green both before this change and while it briefly emitted a broken attention-tip; the script now fails staging on an alert kind it has no block for, which closes that silent path directly instead.

Assisted-by: Claude:claude-opus-5

Bronek added 3 commits August 1, 2026 22:48
Assisted-by: Claude:claude-opus-5
Also drops the claim that libfn suits asynchronous composition. Nothing in
the repository backs it: no example, no reference page, and the paragraph's
one substantiated sentence — that an operation is a value, applied when a
monad is piped into it — is already made where callables as values are
discussed.

Assisted-by: Claude:claude-opus-5
The site showed each of TYPE_ALGEBRA's fourteen alerts as a plain blockquote
opening with a literal `[!NOTE]` line. The quoting comes off before the
existing rewrites, so that a heading or a link inside an alert is treated like
any other — the heading pattern is line-anchored and never matched a quoted
one — and the block is fenced afterwards, longer than any fence it contains.

znai builds an attention block for a fixed set of types and turns anything
else into a code snippet that prints the markdown verbatim, which is how
`attention-tip` passed a green build. An unmapped kind now fails the staging
instead. `[!TIP]` maps to a note block, there being no `tip`; #394 covers
giving the mathematical asides their own styling.

Assisted-by: Claude:claude-opus-5
@augmentcode

augmentcode Bot commented Aug 1, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: Improves the project’s documentation for the 0.1 release by making local build modes reproducible, documenting the C++26 entry point, and fixing docs-site rendering of GitHub-style alerts.

Changes:

  • Expanded CONTRIBUTING.md with copy/pasteable CMake configure/build/test commands and dedicated sections for C++23/C++26 validation, sanitizers, coverage, and documentation export.
  • Updated README.md to describe the libfn::fn_cxx26 CMake target and clarify that consumers should link exactly one of the C++20 or C++26 entry points per target.
  • Enhanced scripts/stage_docs_source.py to translate GitHub alert blockquotes (> [!NOTE]/> [!TIP]/> [!WARNING]) into znai attention-* fenced blocks, while preserving normal prose rewrites inside the alert body.

Technical Notes: The staging script now detects both backtick and tilde fences, fails staging on unknown alert kinds, and fences attention blocks longer than any internal backtick fence to avoid accidental termination.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode 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.

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread CONTRIBUTING.md
Comment thread scripts/stage_docs_source.py
The alert scan walked the lines itself rather than through `outside_fences`,
which this file has so that no rule fires on fenced content. A fence quoting
`> [!NOTE]` as an example of the syntax therefore had its quoting stripped and
markers planted inside the code. No document quotes it today, so nothing
reached the site that way; the invariant is the point.

Assisted-by: Claude:claude-opus-5
@Bronek

Bronek commented Aug 1, 2026

Copy link
Copy Markdown
Member Author

augment review

@augmentcode augmentcode 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.

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread scripts/stage_docs_source.py Outdated
A blockquote also swallows an unquoted line that merely continues its
paragraph, and only a block of its own ends it. Ending the alert at every
unquoted line would split such a body across the attention block, silently.
No document does this today, so the conversion refuses the ambiguity rather
than guessing at it.

Assisted-by: Claude:claude-opus-5
@Bronek

Bronek commented Aug 1, 2026

Copy link
Copy Markdown
Member Author

augment review

@augmentcode augmentcode 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.

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread scripts/stage_docs_source.py
`outside_fences` recognised only backtick fences, so a `~~~` block was exposed
to every rewrite the staging performs — links, headings and badges as much as
alerts. It now tracks the marker that opened the fence and closes on that
character alone, at a run no shorter, so a fence may quote a shorter one of
either kind. No document uses tildes today; the staged output is unchanged.

Assisted-by: Claude:claude-opus-5
@Bronek

Bronek commented Aug 1, 2026

Copy link
Copy Markdown
Member Author

augment review

@augmentcode augmentcode 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.

Review completed. 3 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread scripts/stage_docs_source.py Outdated
Comment thread scripts/stage_docs_source.py Outdated
Comment thread README.md
A block may carry three spaces of indent before it, so an alert marker away
from column zero was read as ordinary prose and a slightly indented list or
fence after one was read as a paragraph that had lost its quoting, failing the
staging. Both now admit those three spaces, and a fourth still makes the line
code rather than either.

Assisted-by: Claude:claude-opus-5
@Bronek

Bronek commented Aug 1, 2026

Copy link
Copy Markdown
Member Author

augment review

@augmentcode augmentcode 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.

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread scripts/stage_docs_source.py
Bronek added 5 commits August 2, 2026 11:17
A closing fence carries no info string, so a line opening a nested
fence of equal length is content, not the closer. Also state the
recognizer's conservative scope in the module docstring.

Assisted-by: Claude:claude-fable-5
CLAUDE.md gains the design gate, the documentation duty and the
editing protocol; TYPE_ALGEBRA.md gains the document-guidelines
contract, with a structural index as its checksum. The Assisted-by
trailer folds into the existing convention, vendor-neutral, citing
the kernel guidelines it follows.

Assisted-by: Claude:claude-fable-5
Section 4's pointer to Section 6 lands on prose stating the
equivalence, not on an inference from the example. The placeholder
types join the quoted definitions block; only the sync markers
move, the example code is unchanged.

Assisted-by: Claude:claude-fable-5
Section 15 gains the ABI-namespace mechanism under its own name —
one normalization order per program — and Section 2's note and
README's loud-by-design sentence now point at it. README's What
section gives the design document its billing. Subheadings settle on
sentence case, choice<>'s incompleteness loses its circular
phrasing, and the narrator's "we" goes.

Assisted-by: Claude:claude-fable-5
@Bronek
Bronek merged commit 41ac614 into main Aug 2, 2026
55 checks passed
@sonarqubecloud

sonarqubecloud Bot commented Aug 2, 2026

Copy link
Copy Markdown

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.

1 participant