Automatic documentation generation#18152
Conversation
|
@nijel, can you share your thoughts on this approach for automating documentation generation ? |
Codecov Report❌ Patch coverage is
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
nijel
left a comment
There was a problem hiding this comment.
I think it's a reasonable approach. See a few comments I've made on the implementation. I will also trigger copilot review to comment on this.
There was a problem hiding this comment.
Pull request overview
Adds scaffolding for automatic documentation generation by introducing version metadata markers for add-ons and updating the list_addons management command to emit/insert auto-generated RST blocks.
Changes:
- Introduced RST “versionadded/versionchanged” metadata helper classes and attached version metadata to various add-ons.
- Extended
./manage.py list_addonsto write generated docs either to stdout or into a file section delimited by markers. - Added human-readable descriptions for add-on events to improve generated documentation.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| weblate/utils/docs.py | Adds RST version metadata helpers for embedding versionadded/versionchanged directives. |
| weblate/addons/base.py | Introduces doc_versions on add-on base class for documentation metadata. |
| weblate/addons/webhooks.py | Adds doc_versions metadata to webhook add-ons. |
| weblate/addons/gettext.py | Updates add-on description formatting and adds versionchanged metadata. |
| weblate/addons/generate.py | Adds versionadded metadata for locale-generation add-ons. |
| weblate/addons/fedora_messaging.py | Adds versionadded metadata for Fedora Messaging add-on. |
| weblate/addons/cleanup.py | Adds versionadded metadata for Remove Blank add-on. |
| weblate/addons/cdn.py | Adds versionadded metadata for CDNJS add-on. |
| weblate/addons/events.py | Adds event description strings used in generated docs. |
| weblate/addons/management/commands/list_addons.py | Adds marker-based insertion into an output file and restructures doc generation output. |
dc20e72 to
f315457
Compare
f315457 to
52ada99
Compare
The approach is to use markers in the target document in order to combine automatically generated content (within the markers) and custom/handwritten content.
This has is drawbacks, but it allows to keep a minimal number of files to maintain, and reduces mix of concern between documentation code and actual logic code.