Convert QAPI doc comments to generate rST instead of texinfo
Status from this message: Queued, thanks!
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v6 Latest21 patches 45 repliesApplied
- v520 patches 41 repliesSuperseded
- v418 patches 25 repliesSuperseded
Earlier versions · 3
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v3 | 12 patches | 7 replies | Superseded | |
| v2 | 30 patches | 37 replies | Superseded | |
| v1 | 29 patches | 45 replies | Superseded |
Changes in v6 from the cover letter
* rebased (in particular, updated to meson build system)
* new patch 1 fixes indent issues that hit master since v5
* new patch 2 makes block-latency-histogram-set's use of Example sections match everybody else's, instead of special casing it in the parser
* the .gitignore got pruned after meson conversion so we only need to change git.orderfile now
* slightly reordered patches to bring the parser.py indent change nearer the start of the series in the hopes of being able to get at least that much of the series into master
* we now tell Sphinx about all the json files for dependency info, so editing a json file correctly rebuilds the docs
* added a test case for the bad-de-indent parser error
* Adopted the various Python scripting suggestions from Markus
* We don't insist on section headings being the only thing in their doc comment block any more (the existing "must be first line" requirement is sufficient)
* added a test case for doc-generation that does a compare of the sphinx plain-text builder output against a reference file
* Added the Python source files for Sphinx extensions (including the QAPI source files) to the dependency lists for the manuals, so that changes made to them correctly trigger a docs rebuild
* qemu-ga-ref.rst and qemu-qmp-ref.rst now have a TODO note about making the manual licensing more visible to readers
* fixed bug in reported file/line info for some errors in rST in doc comments when using Sphinx 1.6
* don't insist on section headers being in their own freeform doc comment block; they're (after commit dcdc07a97cbe) always the first line in the comment block, so just handle the possibility of having text after that.
Patches in v6 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/21 | qapi: Fix doc comment indentation againqapi/ qapi/ | +53 | 1 reply | |
| 2/21 | qapi/block.json: Add newline after "Example:" for block-latency-histogram-setqapi/ | +8 | 3 replies | |
| 3/21 | tests/qapi/doc-good.json: Prepare for qapi-doc Sphinx extensiontests/ tests/ tests/ | +22 | 0 replies | |
| 4/21 | scripts/qapi: Move doc-comment whitespace stripping to doc.pyscripts/ scripts/ tests/ | +11 | 0 replies | |
| 5/21 | scripts/qapi/parser.py: improve doc comment indent handlingdocs/ scripts/ tests/ +4 more | +109 | 3 replies | |
| 6/21 | qapi/machine.json: Escape a literal '*' in doc commentqapi/ | +1 | 1 reply | |
| 7/21 | docs/sphinx: Add new qapi-doc Sphinx extensionMAINTAINERS docs/ docs/ | +556 | 2 replies | |
| 8/21 | docs/interop: Convert qemu-ga-ref to rSTMAINTAINERS docs/ docs/ +6 more | +15 | 4 replies | |
| 9/21 | docs/interop: Convert qemu-qmp-ref to rSTdocs/ docs/ docs/ +5 more | +14 | 6 replies | |
| 10/21 | qapi: Use rST markup for literal blocksqapi/ qapi/ | +13 | 0 replies | |
| 11/21 | qga/qapi-schema.json: Add some headingsqga/ | +5 | 1 reply | |
| 12/21 | tests/qapi-schema: Convert doc-good.json to rST-style strong/emphasistests/ tests/ tests/ | +3 | 1 reply | |
| 13/21 | meson.build: Move SPHINX_ARGS to top level meson.build filedocs/ meson.build | +8 | 1 reply | |
| 14/21 | meson.build: Make manuals depend on source to Sphinx extensionsdocs/ meson.build | +9 | 1 reply | |
| 15/21 | tests/qapi-schema: Add test of the rST QAPI doc-comment outputntests/ tests/ tests/ | +348 | 3 replies | |
| 16/21 | scripts/qapi: Remove texinfo generation supportmeson.build scripts/ scripts/ +3 more | +1 | 1 reply | |
| 17/21 | docs/devel/qapi-code-gen.txt: Update to new rST backend conventionsdocs/ | +53 | 3 replies | |
| 18/21 | scripts/texi2pod: Delete unused scriptscripts/ scripts/ | +1 | 1 reply | |
| 19/21 | Remove Texinfo related line from git.orderfilescripts/ | +0 | 1 reply | |
| 20/21 | configure: Drop texinfo requirementconfigure | +2 | 1 reply | |
| 21/21 | Remove texinfo dependency from docker and CI configs.travis.yml scripts/ tests/ +4 more | +0 | 1 reply |
Reviews trailers per patch
19 of 21 patches have a Reviewed-by or Acked-by.
| Patch | Richard Henderson | Markus Armbruster |
|---|---|---|
| 1/21 | R-b | |
| 2/21 | R-b | |
| 3/21 | R-b | R-b |
| 4/21 | R-b | R-b |
| 5/21 | R-b | |
| 6/21 | R-b | R-b |
| 7/21 | R-b | |
| 8/21 | R-b | R-b |
| 9/21 | ||
| 10/21 | R-b | R-b |
| 11/21 | R-b | R-b |
| 12/21 | R-b | |
| 13/21 | R-b | |
| 14/21 | ||
| 15/21 | R-b | |
| 16/21 | R-b | R-b |
| 17/21 | R-b | R-b |
| 18/21 | R-b | R-b |
| 19/21 | R-b | |
| 20/21 | R-b | R-b |
| 21/21 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v6 00/21] Convert QAPI doc comments to generate rST instead of texinfo
This series switches all our QAPI doc comments over from texinfo format to rST. It then removes all the texinfo machinery, because this was the last user of texinfo.
I think I have now resolved all of Markus' issues raised in his review of v5, and IMHO this is ready to commit. If there are still things needing fixing, it would be nice if we were able to commit patches 1-5, which are the ones which add the new indent-sensitive code to the QAPI parser. That would put a stop to the steady trickle of doc-comment changes which break the new rules...
Also available as a git branch at
https://git.linaro.org/people/peter.maydell/qemu-arm.git sphinx-conversions-v6
The basic approach is somewhat similar to how we deal with kerneldoc and hxtool: we have a custom Sphinx extension which is passed a filename which is the json file it should run the QAPI parser over and generate documentation for. Unlike 'kerneldoc' but somewhat like hxtool, I have chosen to generate documentation by generating a tree of docutils nodes, rather than by generating rST source that is then fed to the rST parser to generate docutils nodes. Individual lumps of doc comment go to the rST parser, but the structured parts we render directly. This makes it easier to get the structure and heading level nesting correct.
Changes from v5:
* rebased (in particular, updated to meson build system)
* new patch 1 fixes indent issues that hit master since v5
* new patch 2 makes block-latency-histogram-set's use of Example sections match everybody else's, instead of special casing it in the parser
* the .gitignore got pruned after meson conversion so we only need to change git.orderfile now
* slightly reordered patches to bring the parser.py indent change nearer the start of the series in the hopes of being able to get at least that much of the series into master
* we now tell Sphinx about all the json files for dependency info, so editing a json file correctly rebuilds the docs
* added a test case for the bad-de-indent parser error
* Adopted the various Python scripting suggestions from Markus
* We don't insist on section headings being the only thing in their doc comment block any more (the existing "must be first line" requirement is sufficient)
* added a test case for doc-generation that does a compare of the sphinx plain-text builder output against a reference file
* Added the Python source files for Sphinx extensions (including the QAPI source files) to the dependency lists for the manuals, so that changes made to them correctly trigger a docs rebuild
* qemu-ga-ref.rst and qemu-qmp-ref.rst now have a TODO note about making the manual licensing more visible to readers
* fixed bug in reported file/line info for some errors in rST in doc comments when using Sphinx 1.6
* don't insist on section headers being in their own freeform doc comment block; they're (after commit dcdc07a97cbe) always the first line in the comment block, so just handle the possibility of having text after that.
There are a few things I have left out of this initial series:
* unlike the texinfo, there is no generation of index entries or an index in the HTML docs
* although there are HTML anchors on all the command/object/etc headings, they are not stable but just serial-number based tags like '#qapidoc-35', so not suitable for trying to link to from other parts of the docs
My view is that we can add niceties like this later; the series already seems big enough to me.
thanks
-- PMM
Peter Maydell (21):
qapi: Fix doc comment indentation again
qapi/block.json: Add newline after "Example:" for
block-latency-histogram-set
tests/qapi/doc-good.json: Prepare for qapi-doc Sphinx extension scripts/qapi: Move doc-comment whitespace stripping to doc.py scripts/qapi/parser.py: improve doc comment indent handling qapi/machine.json: Escape a literal '*' in doc comment docs/sphinx: Add new qapi-doc Sphinx extension docs/interop: Convert qemu-ga-ref to rST
docs/interop: Convert qemu-qmp-ref to rST
qapi: Use rST markup for literal blocks qga/qapi-schema.json: Add some headings
tests/qapi-schema: Convert doc-good.json to rST-style strong/emphasis meson.build: Move SPHINX_ARGS to top level meson.build file meson.build: Make manuals depend on source to Sphinx extensions tests/qapi-schema: Add test of the rST QAPI doc-comment outputn scripts/qapi: Remove texinfo generation support docs/devel/qapi-code-gen.txt: Update to new rST backend conventions scripts/texi2pod: Delete unused script
Remove Texinfo related line from git.orderfile
configure: Drop texinfo requirement
Remove texinfo dependency from docker and CI configs
docs/conf.py | 6 +- docs/devel/qapi-code-gen.txt | 106 ++-- docs/index.html.in | 2 - docs/interop/conf.py | 4 + docs/interop/index.rst | 2 + docs/interop/qemu-ga-ref.rst | 9 + docs/interop/qemu-ga-ref.texi | 80 --- docs/interop/qemu-qmp-ref.rst | 9 + docs/interop/qemu-qmp-ref.texi | 80 --- docs/meson.build | 11 +- docs/sphinx/qapidoc.py | 550 +++++++++++++++++++++ tests/qapi-schema/doc-good.rst | 5 + configure | 12 +- meson.build | 103 +--- qapi/block-core.json | 20 +- qapi/block.json | 12 +- qapi/machine.json | 2 +- qapi/migration.json | 102 ++-- qapi/qapi-schema.json | 6 +- qga/qapi-schema.json | 8 +- .travis.yml | 1 - MAINTAINERS | 3 +- qapi/meson.build | 4 +- qga/meson.build | 3 +- scripts/checkpatch.pl | 2 +- scripts/coverity-scan/coverity-scan.docker | 1 - scripts/git.orderfile | 1 - scripts/qapi-gen.py | 2 - scripts/qapi/doc.py | 301 ----------- scripts/qapi/gen.py | 7 - scripts/qapi/parser.py | 105 +++- scripts/texi2pod.pl | 536 -------------------- tests/docker/dockerfiles/debian10.docker | 1 - tests/docker/dockerfiles/fedora.docker | 1 - tests/docker/dockerfiles/ubuntu.docker | 1 - tests/docker/dockerfiles/ubuntu1804.docker | 1 - tests/docker/dockerfiles/ubuntu2004.docker | 1 - tests/qapi-schema/doc-bad-indent.err | 1 + tests/qapi-schema/doc-bad-indent.json | 8 + tests/qapi-schema/doc-bad-indent.out | 0 tests/qapi-schema/doc-good.json | 27 +- tests/qapi-schema/doc-good.out | 24 +- tests/qapi-schema/doc-good.texi | 319 ------------ tests/qapi-schema/doc-good.txt | 288 +++++++++++ tests/qapi-schema/meson.build | 63 ++- 45 files changed, 1223 insertions(+), 1607 deletions(-) create mode 100644 docs/interop/qemu-ga-ref.rst delete mode 100644 docs/interop/qemu-ga-ref.texi create mode 100644 docs/interop/qemu-qmp-ref.rst delete mode 100644 docs/interop/qemu-qmp-ref.texi create mode 100644 docs/sphinx/qapidoc.py create mode 100644 tests/qapi-schema/doc-good.rst delete mode 100644 scripts/qapi/doc.py delete mode 100755 scripts/texi2pod.pl create mode 100644 tests/qapi-schema/doc-bad-indent.err create mode 100644 tests/qapi-schema/doc-bad-indent.json create mode 100644 tests/qapi-schema/doc-bad-indent.out delete mode 100644 tests/qapi-schema/doc-good.texi create mode 100644 tests/qapi-schema/doc-good.txt
Signature · 1 line
2.20.1