docs: add sphinx-domain rST generator to qapidoc
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest42 patches 24 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/42 | docs/qapidoc: support header-less freeform sectionsdocs/ | +2 | 2 replies | |
| 2/42 | qapi/parser: adjust info location for doc body sectionscripts/ | +5 | 0 replies | |
| 3/42 | docs/qapidoc: remove example section supportdocs/ | +1 | 0 replies | |
| 4/42 | qapi: expand tags to all doc sectionsdocs/ scripts/ tests/ +1 more | +90 | 0 replies | |
| 5/42 | qapi/schema: add __repr__ to QAPIDoc.Sectionscripts/ | +3 | 0 replies | |
| 6/42 | docs/qapidoc: add transmogrifier stubdocs/ | +28 | 0 replies | |
| 7/42 | docs/qapidoc: add transmogrifier class stubdocs/ | +65 | 0 replies | |
| 8/42 | docs/qapidoc: add visit_module() methoddocs/ | +9 | 0 replies | |
| 9/42 | qapi/source: allow multi-line QAPISourceInfo advancingscripts/ | +2 | 0 replies | |
| 10/42 | docs/qapidoc: add visit_freeform() methoddocs/ | +47 | 0 replies | |
| 11/42 | docs/qapidoc: add preamble() methoddocs/ | +31 | 0 replies | |
| 12/42 | docs/qapidoc: add visit_paragraph() methoddocs/ | +9 | 0 replies | |
| 13/42 | docs/qapidoc: add visit_errors() methoddocs/ | +6 | 0 replies | |
| 14/42 | docs/qapidoc: add format_type() methoddocs/ | +28 | 0 replies | |
| 15/42 | docs/qapidoc: add add_field() and generate_field() helper methodsdocs/ | +25 | 0 replies | |
| 16/42 | docs/qapidoc: add visit_feature() methoddocs/ | +9 | 0 replies | |
| 17/42 | docs/qapidoc: prepare to record entity being transmogrifieddocs/ | +6 | 0 replies | |
| 18/42 | docs/qapidoc: add visit_returns() methoddocs/ | +14 | 0 replies | |
| 19/42 | docs/qapidoc: add visit_member() methoddocs/ | +27 | 0 replies | |
| 20/42 | docs/qapidoc: add visit_sections() methoddocs/ | +23 | 0 replies | |
| 21/42 | docs/qapidoc: add visit_entity()docs/ | +13 | 0 replies | |
| 22/42 | docs/qapidoc: implement transmogrify() methoddocs/ | +46 | 0 replies | |
| 23/42 | docs: disambiguate cross-referencesdocs/ docs/ | +8 | 0 replies | |
| 24/42 | docs/qapidoc: add transmogrifier test documentdocs/ docs/ | +54 | 0 replies | |
| 25/42 | docs/qapidoc: generate entries for undocumented membersdocs/ | +1 | 0 replies | |
| 26/42 | qapi/parser: add undocumented stub members to all_sectionsscripts/ | +12 | 0 replies | |
| 27/42 | qapi: differentiate "intro" and "detail" sectionsdocs/ scripts/ tests/ | +25 | 2 replies | |
| 28/42 | qapi/parser: prohibit untagged sections between tagged sectionsqapi/ qapi/ scripts/ +3 more | +28 | 4 replies | |
| 29/42 | qapi: Add "Details:" disambiguation markerqapi/ qapi/ qapi/ +2 more | +20 | 10 replies | |
| 30/42 | docs/qapidoc: add minimalistic inlinerdocs/ | +172 | 0 replies | |
| 31/42 | docs/qapidoc: autogenerate undocumented return docsdocs/ | +13 | 0 replies | |
| 32/42 | docs/qapidoc: Add generated returns documentation to inlinerdocs/ | +8 | 0 replies | |
| 33/42 | docs/qmp: add target to Out-of-band execution sectiondocs/ | +2 | 0 replies | |
| 34/42 | docs/qapidoc: document the "out-of-band" pseudofeaturedocs/ | +8 | 0 replies | |
| 35/42 | docs/qapidoc: generate out-of-band pseudofeature sectionsdocs/ | +6 | 0 replies | |
| 36/42 | qapi/parser: add "meta" kind to QAPIDoc.Kindscripts/ | +1 | 0 replies | |
| 37/42 | qapi/schema: add __iter__ method to QAPISchemaVariantsdocs/ scripts/ scripts/ +2 more | +13 | 0 replies | |
| 38/42 | docs/qapi: add branch support to inlinerdocs/ | +56 | 0 replies | |
| 39/42 | qapi/schema: add doc_visible property to QAPISchemaDefinitionscripts/ | +40 | 0 replies | |
| 40/42 | docs/qapidoc: cull (most) un-named entities from docsdocs/ | +7 | 0 replies | |
| 41/42 | qapi: resolve filenames in info structuresscripts/ tests/ | +4 | 0 replies | |
| 42/42 | docs/qapidoc: add intermediate output debuggerdocs/ | +37 | 0 replies |
Reviews trailers per patch
1 of 42 patches has a Reviewed-by or Acked-by.
| Patch | Markus Armbruster |
|---|---|
| 1/42 | |
| 2/42 | |
| 3/42 | |
| 4/42 | |
| 5/42 | |
| 6/42 | |
| 7/42 | |
| 8/42 | |
| 9/42 | R-b |
| 10/42 | |
| 11/42 | |
| 12/42 | |
| 13/42 | |
| 14/42 | |
| 15/42 | |
| 16/42 | |
| 17/42 | |
| 18/42 | |
| 19/42 | |
| 20/42 | |
| 21/42 | |
| 22/42 | |
| 23/42 | |
| 24/42 | |
| 25/42 | |
| 26/42 | |
| 27/42 | |
| 28/42 | |
| 29/42 | |
| 30/42 | |
| 31/42 | |
| 32/42 | |
| 33/42 | |
| 34/42 | |
| 35/42 | |
| 36/42 | |
| 37/42 | |
| 38/42 | |
| 39/42 | |
| 40/42 | |
| 41/42 | |
| 42/42 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 00/42] docs: add sphinx-domain rST generator to qapidoc
based-on: https://patchew.org/QEMU/[email protected]/
Hiya! This series is based on a rebased version of the above series. Apply the above patches to origin/master and then apply this series and you should be good to go. Or just snitch the patches from my GitLab branch:
https://gitlab.com/jsnow/qemu/-/commits/sphinx-domain-blergh2
(... ignore the branch name. I ran into some problems with stacked git corrupting my branches ...)
If you're just tuning in, this series adds a new sphinx documentation generator for QAPI as presented on at KVM Forum; the big win here is cross-references and indices for QMP commands and events. It depends on the qapi-domain plugin for sphinx which is posted in the pre-requisite series; it's not polished for review and should be considered POC-quality. I felt it was easier to review this series backwards, because the design of the rST generator informs the design of the domain plugin. (Which makes sense: the rST is generated first, and then it's parsed. Our review follows the flow of data through the generator.)
Overview:
Patches 1-24: Mostly the same as in v2; implements the very basics of
the new qapidoc generator. "type" was changed to "kind" for the doc section metadata, and "untagged" changed to "plain". Some small phrasing tweaks here and there.
Patches 25-26: Add auto-generated stub docs for undocumented members.
Patches 27-29: Restrict the source QAPIDoc syntax slightly and
differentiate "plain" sections as either intro or details. Necessary for the inliner.
Patch 30: Add the "inliner", the component that squishes "inherited"
arguments/members into a single reference for commands/events.
Patches 31-32: Add auto-generated documentation for commands that return
a value that is not documented.
Patches 33-35: Document the "out-of-band" property on QMP commands.
Patches 36-38: Add branch support to the inliner. Ish. See below.
Patches 39-40: Cull unused definitions from the generated QMP docs; cull
anything that has been inlined and no longer needs to be documented separately.
Patches 41-42: Add intermediate representation rST document writing in
DEBUG mode
Things notably still not perfect:
(ignoring aesthetics; we care only about the rST generator itself in this series.)
- ifcond for anything other than root level entires is still ignored
- branch inliner ignores all sections except members (ifcond, details, features)
- intro/details separation enforces no plain paragraphs to appear in the "middle" of the documentation section; new markup may be desired if we want to add annotations to categories/regions instead of to specific members/features.
If you want to give this a whirl yourself, build QEMU with documentation support enabled and look at docs/manual/qapi/index.html for a sample generation of the QMP manual using the new system. You probably need sphinx >= 4.0 for the time being to do so.
John Snow (42):
docs/qapidoc: support header-less freeform sections qapi/parser: adjust info location for doc body section docs/qapidoc: remove example section support
qapi: expand tags to all doc sections
qapi/schema: add __repr__ to QAPIDoc.Section docs/qapidoc: add transmogrifier stub
docs/qapidoc: add transmogrifier class stub docs/qapidoc: add visit_module() method
qapi/source: allow multi-line QAPISourceInfo advancing docs/qapidoc: add visit_freeform() method docs/qapidoc: add preamble() method
docs/qapidoc: add visit_paragraph() method docs/qapidoc: add visit_errors() method
docs/qapidoc: add format_type() method
docs/qapidoc: add add_field() and generate_field() helper methods docs/qapidoc: add visit_feature() method
docs/qapidoc: prepare to record entity being transmogrified docs/qapidoc: add visit_returns() method
docs/qapidoc: add visit_member() method
docs/qapidoc: add visit_sections() method docs/qapidoc: add visit_entity()
docs/qapidoc: implement transmogrify() method
docs: disambiguate cross-references
docs/qapidoc: add transmogrifier test document docs/qapidoc: generate entries for undocumented members qapi/parser: add undocumented stub members to all_sections
qapi: differentiate "intro" and "detail" sections qapi/parser: prohibit untagged sections between tagged sections
qapi: Add "Details:" disambiguation marker docs/qapidoc: add minimalistic inliner
docs/qapidoc: autogenerate undocumented return docs docs/qapidoc: Add generated returns documentation to inliner docs/qmp: add target to Out-of-band execution section docs/qapidoc: document the "out-of-band" pseudofeature docs/qapidoc: generate out-of-band pseudofeature sections qapi/parser: add "meta" kind to QAPIDoc.Kind qapi/schema: add __iter__ method to QAPISchemaVariants docs/qapi: add branch support to inliner
qapi/schema: add doc_visible property to QAPISchemaDefinition docs/qapidoc: cull (most) un-named entities from docs
qapi: resolve filenames in info structures docs/qapidoc: add intermediate output debugger
docs/devel/codebase.rst | 6 +- docs/glossary.rst | 10 +- docs/index.rst | 1 + docs/interop/qmp-spec.rst | 2 + docs/qapi/index.rst | 53 +++ docs/sphinx/qapidoc.py | 716 ++++++++++++++++++++++++++++++-- qapi/machine.json | 2 + qapi/migration.json | 4 + qapi/net.json | 4 +- qapi/qom.json | 8 +- qapi/yank.json | 2 + scripts/qapi/introspect.py | 4 +- scripts/qapi/parser.py | 178 ++++++-- scripts/qapi/schema.py | 48 ++- scripts/qapi/source.py | 4 +- scripts/qapi/types.py | 4 +- scripts/qapi/visit.py | 4 +- tests/qapi-schema/doc-good.json | 4 +- tests/qapi-schema/doc-good.out | 12 +- tests/qapi-schema/doc-good.txt | 8 +- tests/qapi-schema/test-qapi.py | 4 +- 21 files changed, 975 insertions(+), 103 deletions(-) create mode 100644 docs/qapi/index.rst
Signature · 1 line
2.48.1