mirror of
https://github.com/nlohmann/json.git
synced 2026-10-03 05:00:30 +00:00
Review and extend the documentation, and check it in CI
A review of all documentation pages found factual errors, dead links, missing cross-references, and gaps in examples. This fixes them and adds checks so the same problems are caught automatically. Fixes: - wrong signatures and version histories (operator!= C++20 member, binary() subtype type, get<PointerType>(), JSON_NO_THREAD_LOCAL, ...) - stale descriptions (number parsing since #5283, UBJSON table, SAX example that no longer compiled, tsl::ordered_map advice) - dead internal and external links; repology.org badges (the domain is suspended) replaced by badges that query the registries directly - deprecation notes link the migration guide; the guide itself fixed Additions: - "See also" sections, cross-references, 25 runnable examples, 12 Mermaid diagrams, new API pages for json_pointer::operator<=> and byte_container_with_subtype::operator==/!= - landing page, guides for untrusted input and performance - "unreleased" badge after versions newer than the latest release Checks: - strict documentation build (broken links/anchors fail it); CI and the publish workflow fetch the full history the build needs - weekly external link check, Mermaid syntax check in CI - check_structure.py: example titles, heading levels, alt texts, header links, docset index coverage; its unused-example check works again - all examples produce the same output on every platform Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
+12
-1
@@ -1,3 +1,8 @@
|
||||
# The MkDocs 2.0 banners of Material for MkDocs and ProperDocs (via mkdocs-redirects) are printed to stderr, not
|
||||
# logged, so they do not affect --strict; silence them anyway.
|
||||
export NO_MKDOCS_2_WARNING := true
|
||||
export DISABLE_MKDOCS_2_WARNING := true
|
||||
|
||||
# serve the site locally
|
||||
serve: style_check
|
||||
venv/bin/mkdocs serve
|
||||
@@ -8,11 +13,17 @@ serve_dirty: style_check
|
||||
# This target is used in the CI (ci_test_build_documentation).
|
||||
# This target is used by the docset Makefile.
|
||||
build: style_check
|
||||
venv/bin/mkdocs build
|
||||
venv/bin/mkdocs build --strict
|
||||
|
||||
style_check:
|
||||
@cd docs ; ../venv/bin/python3 ../scripts/check_structure.py
|
||||
|
||||
# check that all Mermaid diagrams parse (needs Node.js)
|
||||
# This target is used in the CI (ci_test_documentation_mermaid).
|
||||
check_mermaid:
|
||||
npm ci --prefix scripts/mermaid --ignore-scripts --no-audit --no-fund
|
||||
node scripts/mermaid/check_mermaid.mjs docs
|
||||
|
||||
# check the links in the documentation files in docs/mkdocs
|
||||
link_check:
|
||||
ENABLED_HTMLPROOFER=true venv/bin/mkdocs build
|
||||
|
||||
Reference in New Issue
Block a user