Conversation
A clean `mkdocs build` says nothing about whether a link still points at a heading that exists, or whether a quiz question has an answer. Both fail silently: the reader lands at the top of a page, or clicks four options and is told all of them are wrong. Four of the eight defects found in the recent review were of exactly this kind. tools/check_links.py walks the *built* site rather than the markdown, for two reasons. Heading anchors come from the slugifier, so checking sources means reimplementing it and hoping the copy stays honest. And under /nb/ mkdocs-static-i18n has already chosen between the translation and the English fallback — which is what makes an English anchor like #range-based-for resolve to a Norwegian page whose slug is #range-basert-for. Currently 11516 links, all resolving. tools/check_quizzes.py asserts every question has exactly one correct option, at least three options, and that no authoring syntax leaked through a block the hook failed to parse. tools/selftest.py plants a known defect in a copy of the site and asserts the checkers catch it. This is not ceremony — writing it found two real holes. check_links.py ignores the theme navigation, so a test mutating a nav link proves nothing; and check_quizzes.py looked for leaked syntax only on pages where a quiz had parsed, skipping the check in exactly the case where the hook had failed. The second was a genuine bug, fixed here. Also fixes Chapter5/templates.md, which used std::string without including <string>. The page quotes the template-deduction error, but a reader pasting the code got "std::string is not a member of std" first. Verified: with the include, the deduction error is the first one. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A clean
mkdocs buildsays nothing about whether a link still points at a heading that exists, or whether a quiz question has an answer. Both fail silently: the reader lands at the top of a page, or clicks four options and is told all of them are wrong. Four of the eight defects found in the recent review were of exactly this kind.tools/check_links.py walks the built site rather than the markdown, for two reasons. Heading anchors come from the slugifier, so checking sources means reimplementing it and hoping the copy stays honest. And under /nb/ mkdocs-static-i18n has already chosen between the translation and the English fallback — which is what makes an English anchor like #range-based-for resolve to a Norwegian page whose slug is #range-basert-for. Currently 11516 links, all resolving.
tools/check_quizzes.py asserts every question has exactly one correct option, at least three options, and that no authoring syntax leaked through a block the hook failed to parse.
tools/selftest.py plants a known defect in a copy of the site and asserts the checkers catch it. This is not ceremony — writing it found two real holes. check_links.py ignores the theme navigation, so a test mutating a nav link proves nothing; and check_quizzes.py looked for leaked syntax only on pages where a quiz had parsed, skipping the check in exactly the case where the hook had failed. The second was a genuine bug, fixed here.
Also fixes Chapter5/templates.md, which used std::string without including . The page quotes the template-deduction error, but a reader pasting the code got "std::string is not a member of std" first. Verified: with the include, the deduction error is the first one.