You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
qemu/docs/sphinx
John Snow 636c96cd77 qapi: Fix undocumented return values by generating something
Generated command documentation lacks information on return value in
several cases, e.g. query-tpm.

The obvious fix would be to require a Returns: section when a command
returns something.

However, note that many existing Returns: sections are pretty useless:
the description is basically the return type, which then gets rendered
like "Return: <Type> – <basically the return type>".  This suggests
that a description is often not really necessary, and requiring one
isn't useful.

Instead, generate the obvious minimal thing when Returns: is absent:
"Return: <Type>".

This auto-generated Return documentation is placed is as follows:

1. If we have arguments, return goes right after them.
2. Else if we have errors, return goes right before them.
3. Else if we have features, return goes right before them.
4. Else return goes right after the intro

To facilitate this algorithm, a "TODO:" hack line is used to separate
the intro from the remainder of the documentation block in cases where
there are no other sections to separate the intro from e.g. examples and
additional detail meant to appear below the key sections of interest.

Signed-off-by: John Snow <jsnow@redhat.com>
Message-ID: <20250711051045.51110-3-jsnow@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[_insert_near_kind() code replaced by something simpler, commit
message amended to explain why we're doing this]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
6 days ago
..
compat.py docs/qapi-domain: Fix error context reporting in Sphinx 5.x and 6.x 4 months ago
dbusdoc.py docs/sphinx: add sphinx modules to include D-Bus documentation 4 years ago
dbusdomain.py meson: Pass -j option to sphinx 2 years ago
dbusparser.py docs/sphinx: add sphinx modules to include D-Bus documentation 4 years ago
depfile.py docs/sphinx: include kernel-doc script as a dependency 6 months ago
fakedbusdoc.py meson: Pass -j option to sphinx 2 years ago
hxtool.py docs: remove Sphinx 1.x compatibility code 1 year ago
kerneldoc.py docs: remove Sphinx 1.x compatibility code 1 year ago
qapi_domain.py docs/qapi-domain: add return-nodesc 6 days ago
qapidoc.py qapi: Fix undocumented return values by generating something 6 days ago
qmp_lexer.py docs/sphinx/qmp_lexer: Highlight elisions like comments, not prompts 3 months ago