docs: modernize doxygen build and publish from this repository - #1711
Merged
Conversation
The API docs were last published to the separate jsoncpp-docs repo in January 2021 (for 1.9.4) and the local doxygen build has been broken since the versioning rework removed the top-level `version` file. Build fixes: - doxybuild.py reads the version from include/json/version.h instead of a `version` file that CMake only generates in the build directory. - doc/doxyfile.in is reduced to the non-default settings (the 2013-era 1.8.5 template triggered 17 obsolete-tag warnings on current doxygen) and now sets WARN_AS_ERROR so documentation regressions fail the build. - JSONCPP_DEPRECATED/JSON_API are stripped during preprocessing and __cplusplus=201703L is predefined, so deprecated members and the std::string_view overloads are documented. Documentation fixes: - reader.h / writer.h: a mismatched 'settings_` quote opened a backtick span that swallowed the rest of each header, leaving CharReaderBuilder and StreamWriterBuilder effectively undocumented. - value.h: document the remaining parameters of Value::get and Value::removeMember. - json_value.cpp: hide the private Value::CZString implementation from doxygen with \cond. Output: - Style with doxygen-awesome-css v2.4.2 (vendored, MIT) in place of the 1.8.13-era header/footer templates; enable tree view and search. - Use README.md as the main page; jsoncpp.dox becomes a "Quick start" page with the dead SourceForge links removed. Drop the 3-line roadmap stub and the redundant web_doxyfile.in. Publishing: - New docs workflow builds on pull requests (as a warning check) and deploys to GitHub Pages on pushes to master with a pinned, checksum-verified doxygen 1.18.0. README links now point at https://open-source-parsers.github.io/jsoncpp/. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Coverage Report for CI Build 32424602421Coverage remained the same at 89.907%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
|
| Filename | Overview |
|---|---|
| .github/workflows/docs.yml | Adds pinned documentation build and Pages deployment jobs; the current ref guard restricts publishing to master. |
| doxybuild.py | Sources the version from the public version header, improves warning reporting, and removes nonexistent tarball inputs. |
| doc/doxyfile.in | Replaces the obsolete generated template with a concise modern Doxygen configuration that enables strict warnings and themed HTML output. |
| include/json/reader.h | Repairs documentation markup so reader builder documentation renders correctly. |
| include/json/value.h | Completes parameter documentation for existing Value APIs. |
| include/json/writer.h | Repairs documentation markup so writer builder documentation renders correctly. |
| src/lib_json/json_value.cpp | Excludes the private CZString implementation from generated public documentation. |
Sequence Diagram
sequenceDiagram
participant Trigger as Push / PR / Manual Trigger
participant Build as Documentation Build
participant Artifact as Pages Artifact
participant Deploy as Pages Deployment
Trigger->>Build: Run docs workflow
Build->>Build: Generate Doxygen HTML
Build->>Artifact: Upload generated site
alt ref is master
Artifact->>Deploy: Deploy to GitHub Pages
else ref is not master
Artifact-->>Trigger: Build check only
end
Reviews (4): Last reviewed commit: "docs: restrict Pages deploy to master, f..." | Re-trigger Greptile
zizmor requires actions pinned to commit SHAs and persist-credentials off. The caller graph for Json::Value::Value exceeded doxygen's node limit in CI, which WARN_AS_ERROR turned into a failure; caller graphs of the implementation add little to API docs, so drop them and leave headroom in DOT_GRAPH_MAX_NODES for the remaining graphs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
workflow_dispatch from a non-master branch could previously publish that branch's docs over the production site. The tarball list also still referenced NEWS.txt and version, neither of which exists in the tree. Co-Authored-By: Claude Fable 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.
Summary
The published API docs live in the separate jsoncpp-docs repo, last updated January 2021 for 1.9.4. The local doxygen build has also been broken since the versioning rework removed the top-level
versionfile. This PR fixes the build, modernizes the output, and publishes docs from this repository via GitHub Pages so they can no longer rot.Build fixes
doxybuild.pyreads the version frominclude/json/version.hinstead of aversionfile that CMake only writes to the build dir.doc/doxyfile.inreduced to non-default settings (the 1.8.5-era template produced 17 obsolete-tag warnings on current doxygen) and now setsWARN_AS_ERROR = FAIL_ON_WARNINGS, so doc regressions fail CI.JSONCPP_DEPRECATED/JSON_APIare stripped during preprocessing and__cplusplus=201703Lis predefined, so deprecated members and thestd::string_viewoverloads get documented.Documentation fixes
reader.h/writer.h: a mismatched'settings_\`` quote opened a backtick span that swallowed the rest of each header —CharReaderBuilderandStreamWriterBuilder` were effectively undocumented on the published site.value.h: document the remaining params ofValue::get/Value::removeMember.json_value.cpp: hide the privateValue::CZStringimplementation with\cond.Output
README.mdis the main page;jsoncpp.doxbecomes a "Quick start" page with dead SourceForge links removed. Dropped the 3-lineroadmap.doxand the redundantweb_doxyfile.in.Publishing
docsworkflow: builds on PRs (warning check only) and deploys to GitHub Pages on pushes tomaster, using a pinned, checksum-verified doxygen 1.18.0. README links point at https://open-source-parsers.github.io/jsoncpp/.Test plan
python3 doxybuild.pyon macOS with doxygen 1.18.0: exit 0, empty warning log (previously 66 warning lines).[!NOTE]alert renders as a doxygen note), Quick start page present,settings_docs restored on both builders, deprecatedgetFormatedErrorMessagesdocumented,string_viewoverloads shown,CZStringabsent.clang-format --dry-run --Werrorclean on touched C++ files;-fsyntax-onlypasses (changes are comment-only).docsworkflowbuildjob passes on this PR.deployjob publishes to https://open-source-parsers.github.io/jsoncpp/ (Pages has been enabled with source "GitHub Actions"); then redirect + archivejsoncpp-docs.