-
Notifications
You must be signed in to change notification settings - Fork 696
feat: config docs generator #6171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: config docs generator #6171
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #6171 +/- ##
===========================================
+ Coverage 83.42% 83.70% +0.27%
===========================================
Files 546 549 +3
Lines 392583 396519 +3936
Branches 323 323
===========================================
+ Hits 327531 331901 +4370
+ Misses 65044 64610 -434
Partials 8 8
... and 52 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
…or literal and folded block scalars
I definitely love it, I would just make it less "hardcoded" (see my comments) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some structure changes are needed - duplicate changes as #6168, and the produced markdown sholdn't be commited (but should be auto-generated)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
2de8ade
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
Dpn't be too scared! Many of the line changes are due to the final Markdown, the updated comments (already in review in #6168) and the tests!
This PR introduces a new workspace member,
config-docs-generator
, a tool designed to automatically generate Markdown documentation for Stacks node TOML configuration options. The documentation is extracted directly from Rust source code comments, primarily fromstackslib/src/config/mod.rs
and other specified locations.The
config-docs-generator
consists of two main binaries:extract-docs
: This binary usescargo +nightly rustdoc --output-format json
to generate documentation in JSON format. It then parses this JSON to extract structured documentation for specified configuration structs, including descriptions, default values (resolving constant references across crates), notes, deprecation messages, and TOML examples.generate-markdown
: This binary takes the JSON output fromextract-docs
and converts it into a comprehensive Markdown file (docs/generated/configuration-reference.md
), complete with a table of contents and cross-references.A shell script,
contrib/tools/config-docs-generator/generate-config-docs.sh
, orchestrates the building of these tools and the entire documentation generation pipeline.A
Dockerfile
builds theconfig-docs-generator
tools and sets its entrypoint togenerate-config-docs.sh
. This allows for generating configuration documentation in a consistent, containerized environment.Applicable issues
Additional info (benefits, drawbacks, caveats)
Benefits:
Drawbacks/Caveats:
extract-docs
tool relies on the nightlyrustdoc
JSON output format (-Z unstable-options --output-format json
)Checklist
docs/rpc/openapi.yaml
andrpc-endpoints.md
for v2 endpoints,event-dispatcher.md
for new events)clarity-benchmarking
repobitcoin-tests.yml