diff options
author | Markus Armbruster <armbru@redhat.com> | 2025-04-04 14:14:07 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2025-04-08 09:04:34 +0200 |
commit | e27608d05370a5c11f641bd96095afb2d06c5880 (patch) | |
tree | 40dc2d16aa8670a39e1e8bd73658d866134ececf | |
parent | 0d4c7ea0f8b8655f55cb33f6a75243a2dcb64447 (diff) | |
download | qemu-e27608d05370a5c11f641bd96095afb2d06c5880.zip qemu-e27608d05370a5c11f641bd96095afb2d06c5880.tar.gz qemu-e27608d05370a5c11f641bd96095afb2d06c5880.tar.bz2 |
docs/devel/qapi-code-gen: Improve the part on qmp-example directive
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20250404121413.1743790-6-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
-rw-r--r-- | docs/devel/qapi-code-gen.rst | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/docs/devel/qapi-code-gen.rst b/docs/devel/qapi-code-gen.rst index ad51734..25a46fa 100644 --- a/docs/devel/qapi-code-gen.rst +++ b/docs/devel/qapi-code-gen.rst @@ -1038,20 +1038,15 @@ default to "Example:". A simple QMP example:: # .. qmp-example:: - # :title: Using query-block # - # -> { "execute": "query-block" } - # <- { ... } + # -> { "execute": "query-name" } + # <- { "return": { "name": "Fred" } } More complex or multi-step examples where exposition is needed before or between QMP code blocks can be created by using the ``:annotated:`` directive option. When using this option, nested QMP code blocks must be entered explicitly with rST's ``::`` syntax. -Highlighting in non-QMP languages can be accomplished by using the -``.. code-block:: lang`` directive, and non-highlighted text can be -achieved by omitting the language argument. - For example:: # .. qmp-example:: @@ -1061,11 +1056,21 @@ For example:: # This is a more complex example that can use # ``arbitrary rST syntax`` in its exposition:: # - # -> { "execute": "query-block" } - # <- { ... } + # -> { "execute": "query-block" } + # <- { "return": [ + # { + # "device": "ide0-hd0", + # ... + # } + # ... + # ] } # # Above, lengthy output has been omitted for brevity. +Highlighting in non-QMP languages can be accomplished by using the +``.. code-block:: lang`` directive, and non-highlighted text can be +achieved by omitting the language argument. + Examples of complete definition documentation:: |