qemu/docs/sphinx
Markus Armbruster 55b151b6a6 sphinx/qapidoc: Fix to generate doc for explicit, unboxed arguments
When a command's arguments are specified as an explicit type T,
generated documentation points to the members of T.

Example:

    ##
    # @announce-self:
    #
    # Trigger generation of broadcast RARP frames to update network
    [...]
    ##
    { 'command': 'announce-self', 'boxed': true,
      'data' : 'AnnounceParameters'}

generates

    "announce-self" (Command)
    -------------------------

    Trigger generation of broadcast RARP frames to update network
    [...]

    Arguments
    ~~~~~~~~~

    The members of "AnnounceParameters"

Except when the command takes its arguments unboxed , i.e. it doesn't
have 'boxed': true, we generate *nothing*.  A few commands have a
reference in their doc comment to compensate, but most don't.

Example:

    ##
    # @blockdev-snapshot-sync:
    #
    # Takes a synchronous snapshot of a block device.
    #
    # For the arguments, see the documentation of BlockdevSnapshotSync.
    [...]
    ##
    { 'command': 'blockdev-snapshot-sync',
      'data': 'BlockdevSnapshotSync',
      'allow-preconfig': true }

generates

    "blockdev-snapshot-sync" (Command)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Takes a synchronous snapshot of a block device.

    For the arguments, see the documentation of BlockdevSnapshotSync.
    [...]

Same for event data.

Fix qapidoc.py to generate the reference regardless of boxing.  Delete
now redundant references in the doc comments.

Fixes: 4078ee5469 (docs/sphinx: Add new qapi-doc Sphinx extension)
Cc: qemu-stable@nongnu.org
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20240628112756.794237-1-armbru@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
(cherry picked from commit e389929d19)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
(Mjt: context fixups in qapi/block-core.json due to missing
 v8.2.0-1951-g2746f060be18 "qapi: Move error documentation to new "Errors" sections"
 v8.2.0-1952-g53d5c36d8de3 "qapi: Delete useless "Returns" sections")
2024-07-08 22:55:53 +03:00
..
dbusdoc.py docs/sphinx: add sphinx modules to include D-Bus documentation 2021-12-21 10:50:21 +04:00
dbusdomain.py meson: Pass -j option to sphinx 2023-05-18 08:53:50 +02:00
dbusparser.py docs/sphinx: add sphinx modules to include D-Bus documentation 2021-12-21 10:50:21 +04:00
depfile.py docs/sphinx: add templates files to generated depfile 2021-11-08 12:27:23 +04:00
fakedbusdoc.py meson: Pass -j option to sphinx 2023-05-18 08:53:50 +02:00
hxtool.py docs/sphinx: avoid invalid escape in Python string 2023-10-17 15:20:53 +02:00
kerneldoc.py docs/sphinx/kerneldoc.py: Honour --enable-werror 2023-03-16 14:39:10 +01:00
kernellog.py docs: import Linux kernel-doc script and extension 2019-12-17 19:36:32 +01:00
qapidoc.py sphinx/qapidoc: Fix to generate doc for explicit, unboxed arguments 2024-07-08 22:55:53 +03:00
qmp_lexer.py meson: Pass -j option to sphinx 2023-05-18 08:53:50 +02:00