Repository navigation
Fix raw-TeX formulas and other documentation infrastructure debt - #5736
Merged
Merged
Conversation
The privacy plugin self-hosts MathJax 2.7.0 but drops its ?config=TeX-MML-AM_CHTML query string, so the rehosted script loads no input jax and the 10 formulas across 6 pages render as raw TeX to readers. Remove pymdownx.arithmatex and the MathJax extra_javascript entry, and rewrite the formulas in plain HTML (<sup>, <i>) instead. This also drops a nine-year-old third-party script from every page. Part of #5718 Signed-off-by: Niels Lohmann <mail@nlohmann.me>
publish_documentation.yml only triggered on docs/mkdocs/** pushes, but
the site also embeds .github/CODE_OF_CONDUCT.md, CONTRIBUTING.md,
SECURITY.md, cmake/{clang,gcc}_flags.cmake, .clang-tidy,
tools/astyle/.astylerc and tests/fmt_formatter/project/main.cpp via
pymdownx.snippets, so changes to those files never republished the
site. Extend the path filter to cover them, and switch runs-on from
the long-pinned ubuntu-22.04 to ubuntu-latest to match
ci_test_documentation.
Also add persist-credentials: false to the checkouts in ci_icpx and
ci_nvhpc (ubuntu.yml) and msvc-vs2026/msvc-arm64 (windows.yml), none
of which pushes with git, matching every other checkout in these
workflows.
Part of #5718
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
docs/Makefile's debug echo used a space instead of a comma in $(call cxx_standard ...), so it always printed an empty standard. Every example was also compiled with -Wno-deprecated-declarations, which would silently hide an accidental deprecated-API call in any of them. Factor the duplicated compile flags into EXAMPLE_CPPFLAGS/ EXAMPLE_WARNFLAGS, build with -Werror=deprecated-declarations by default, and only allow the three examples that intentionally document deprecated API (the DEPRECATED_EXAMPLES list) to suppress it. Part of #5718 Signed-off-by: Niels Lohmann <mail@nlohmann.me>
`line.strip("<!-- NOLINT")` followed by `.strip(" -->")` strips any of
the characters in those sets from both ends, not a literal prefix; it
only happened to work for "Examples". A NOLINT'd section name
starting with N, O, L, I or T (e.g. "Notes", "Template parameters",
"Iterator invalidation", "Literals") was silently mangled, so the
suppression did not apply and the checker could report a spurious
missing/misordered section. Parse the comment with a regex instead.
The same fragile strip() pattern was used for heading text; replace it
with a plain prefix slice. Also fix the admonition_title report, which
used the 0-based line index while every other report in the file uses
lineno+1.
Part of #5718
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
The README told readers to run `make nlohmann_json.docset`, but the Makefile's targets are `all`, `JSON_for_Modern_C++.docset` and `install_docset_zeal`; the documented command has failed with "No rule to make target" since #2967 (2021). Point the README at the real target and folder name. Info.plist's DashDocSetFallbackURL also still pointed at the old nlohmann.github.io/json/ URL instead of the canonical https://json.nlohmann.me/ from mkdocs.yml's site_url. Leave list_missing_pages/list_removed_paths alone: they may become redundant once #5638's check_docset() lands, which is a follow-up. Part of #5718 Signed-off-by: Niels Lohmann <mail@nlohmann.me>
parse__iterator_pair.link and parse__pointers.link each held only a Wandbox "online" permalink from the old Doxygen docs. #3071 deleted every other .link file in 2021; these two came in through a parallel PR (#3100) and were never referenced by any page, script or config. Part of #5718 Signed-off-by: Niels Lohmann <mail@nlohmann.me>
The MacPorts "Example: CMake" block included integration/homebrew/example.cpp and integration/homebrew/CMakeLists.txt instead of the MacPorts files right next to it, a copy-paste slip from the Homebrew section. Nothing referenced integration/macports/CMakeLists.txt as a result. The page rendered correctly only because the homebrew, macports and vcpkg/CMakeLists.txt snippets are byte-identical, so a future edit to the MacPorts files would not have shown up on the page. Part of #5718 item 6 Signed-off-by: Niels Lohmann <mail@nlohmann.me>
The checkout step in publish_documentation.yml left the default persist-credentials: true, so GITHUB_TOKEN stayed writable in .git/config for the rest of the job (zizmor's artipacked finding). The Deploy documentation step authenticates through its own github_token input to peaceiris/actions-gh-pages and does not push with the checked-out credentials, so persist-credentials: false is safe here, matching every other checkout in the workflow set. Overlaps #5638, which edits this same checkout step (adds fetch-depth: 0); expect a rebase conflict there. Part of #5718 item 2 Signed-off-by: Niels Lohmann <mail@nlohmann.me>
The docset Makefile's list_missing_pages ran one sqlite3 query per mkdocs page, and list_removed_paths nested a loop over all mkdocs pages inside a loop over all docset index paths (O(n*m) shell iteration). Issue #5718 item 5 suggested removing or reducing these targets once #5638's check_docset() lands, but that PR is still open and covers only API pages and macros, not the full page set these targets check. Replace the loops with two sorted path lists (DOCSET_PAGE_PATHS from mkdocs' markdown sources, DOCSET_INDEX_PATHS from the built docset index) compared with a single comm(1) call each, verified to produce output identical to the old loops against the current docSet.dsidx. The sed expression used '#' as its delimiter, which GNU Make reads as a comment character even inside a variable assignment, truncating the line and orphaning the closing paren of $(shell ...) ("unterminated call to function 'shell': missing ')'"). Use '@' as the delimiter instead. Part of #5718 item 5 Signed-off-by: Niels Lohmann <mail@nlohmann.me>
gregmarr
approved these changes
Sep 30, 2026
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.
Summary
This removes six independent pieces of documentation-infrastructure debt identified in the #5718 tech-debt review: math formulas silently rendering as raw TeX on the published site, a docs-publish workflow that misses several embedded source files and persists unneeded git credentials, an example build that hides accidental deprecated-API calls, a structure checker with a parsing bug that silently disables NOLINT for several section names, a docset README/Info.plist pointing at a dead target and a stale URL, and two orphaned Doxygen-era files. Each commit is exactly one checklist item of #5718 and can be reviewed and merged on its own. Note that the math-formula fix (item 1) removes MathJax entirely and rewrites the 10 affected formulas as plain HTML (
<sup>,<i>) rather than repairing the MathJax configuration or migrating to MathJax 3 — a reviewer may prefer keeping MathJax and fixing the config/privacy-plugin interaction instead. The follow-up commits listed under "Remaining checklist items" implement every item that was left open, so this PR now closes #5718; see "Public API" for their effects.Changes
pymdownx.arithmatexand the MathJaxextra_javascriptentry frommkdocs.yml, and rewrite the 10 affected formulas across 6 pages as plain HTML (<sup>,<i>); the privacy plugin was dropping MathJax's?config=query, so the formulas rendered as raw TeX on the published site (Docs infrastructure: MathJax formulas render as raw TeX, publish workflow misses snippet sources, example build hides deprecations, check script and docset fixes #5718 item 1)publish_documentation.yml's path filter to the seven files embedded viapymdownx.snippets(.clang-tidy,CODE_OF_CONDUCT.md,CONTRIBUTING.md,SECURITY.md,cmake/clang_flags.cmake,cmake/gcc_flags.cmake,tests/fmt_formatter/project/main.cpp,tools/astyle/.astylerc), switch its runner from the long-pinnedubuntu-22.04toubuntu-latest, and addpersist-credentials: falseto theci_icpx/ci_nvhpc(ubuntu.yml) andmsvc-vs2026/msvc-arm64(windows.yml) checkouts, none of which push with git (Docs infrastructure: MathJax formulas render as raw TeX, publish workflow misses snippet sources, example build hides deprecations, check script and docset fixes #5718 item 2)docs/Makefile's debug echo (a space instead of a comma left it printing an empty standard), deduplicate the example compile flags intoEXAMPLE_CPPFLAGS/EXAMPLE_WARNFLAGS, and build with-Werror=deprecated-declarationsby default so an accidental deprecated-API call in an example is no longer silently hidden, except for the three examples that intentionally document deprecated API (Docs infrastructure: MathJax formulas render as raw TeX, publish workflow misses snippet sources, example build hides deprecations, check script and docset fixes #5718 item 3)check_structure.py's NOLINT parsing, which usedstr.strip(chars)and silently mangled any section name starting with N, O, L, I or T (e.g. "Notes", "Iterator invalidation") instead of stripping a literal prefix, by switching to a regex; also fix theadmonition_titlereport, which used a 0-based line index while every other report in the file useslineno+1(Docs infrastructure: MathJax formulas render as raw TeX, publish workflow misses snippet sources, example build hides deprecations, check script and docset fixes #5718 item 4)JSON_for_Modern_C++.docsetmake target and folder name instead of the non-existentnlohmann_json.docset, and updateInfo.plist'sDashDocSetFallbackURLto the canonicalhttps://json.nlohmann.me/(Docs infrastructure: MathJax formulas render as raw TeX, publish workflow misses snippet sources, example build hides deprecations, check script and docset fixes #5718 item 5)parse__iterator_pair.linkandparse__pointers.link, two orphaned Doxygen-era permalink files left over from before Consolidate documentation #3071's cleanup, unreferenced by any page, script or config (Docs infrastructure: MathJax formulas render as raw TeX, publish workflow misses snippet sources, example build hides deprecations, check script and docset fixes #5718 item 7)Tests
make check_output_portable -j3 -kwas run over all 480docs/Makefileexamples with-Werror=deprecated-declarations: every example compiled cleanly except the three inDEPRECATED_EXAMPLES, which compiled with-Wno-deprecated-declarationsas intended; the only failures were pre-existingunordered_mapiteration-order flakiness in three unrelated example tests, confirmed to fail identically on unmodified developmake style_check(docs/mkdocs) gave 0 warnings before and after thecheck_structure.pyfix; the regex fix was also verified directly against<!-- NOLINT Notes -->, which previously mangled to'otes'mkdocs build; the builtsite/contains no MathJax/arithmatex references, and the rewritten formulas (e.g.2<sup>53</sup>,<i>n</i>) appear in the built HTMLyaml.safe_loadgit grepconfirmed the two removed.linkfiles and the docset's old make target/URL are unreferenced anywhere else in the treemake check-amalgamationpasses; noinclude/files are touched by this branch, sosingle_include/nlohmann/json.hppis unchangedci_test_documentation/ci_test_examples/actionlint/zizmorjobs; that the extendedpublish_documentation.ymlpath filter actually triggers a real run for the newly added file patterns; and that noartipackedfinding remains for the workflow checkoutsPublic API
No breaking changes. This PR touches only documentation content and infrastructure (
docs/mkdocs/**,.github/workflows/publish_documentation.yml,.github/workflows/ubuntu.yml,.github/workflows/windows.yml,docs/Makefile,docs/mkdocs/scripts/check_structure.py,docs/docset/README.md,docs/docset/Info.plist) and two unreferenced example.linkfiles. No file underinclude/orsingle_include/is changed, so the public API, ABI and compile-time behavior of the library are unaffected.Follow-up commits:
Remaining checklist items (follow-up commits)
The parts that were left open are now implemented here as well, so this PR closes #5718.
5b249592dMake the MacPorts CMake example include its own snippet files instead of the Homebrew ones (Docs infrastructure: MathJax formulas render as raw TeX, publish workflow misses snippet sources, example build hides deprecations, check script and docset fixes #5718 item 6)c0aa5f0e5Addpersist-credentials: falsetopublish_documentation.yml's own checkout (Docs infrastructure: MathJax formulas render as raw TeX, publish workflow misses snippet sources, example build hides deprecations, check script and docset fixes #5718 item 2)45dc218a1Replace the quadratic shell loops of the docset Makefile'slist_missing_pages/list_removed_pathswith acomm(1)diff of two sorted lists (Docs infrastructure: MathJax formulas render as raw TeX, publish workflow misses snippet sources, example build hides deprecations, check script and docset fixes #5718 item 5)Tests for these commits:
list_missing_pages/list_removed_pathsgive byte-identical output to the old loops against the realdocSet.sqland docs tree, with GNU Make 3.81 and 4.4.1 and in two localespublish_documentation.ymlparsesc0aa5f0e5overlaps #5638, which edits the same checkout step. #5718 item 5 suggested removing the two targets once #5638'scheck_docset()exists; until then they are kept, but fixed.Closes #5718
This PR was written by Claude Code on behalf of @nlohmann.
🤖 Generated with Claude Code