mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-17 07:02:03 -06:00
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>
This commit is contained in:
parent
0d4c7ea0f8
commit
e27608d053
1 changed files with 14 additions and 9 deletions
|
@ -1038,20 +1038,15 @@ default to "Example:".
|
||||||
A simple QMP example::
|
A simple QMP example::
|
||||||
|
|
||||||
# .. 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
|
More complex or multi-step examples where exposition is needed before
|
||||||
or between QMP code blocks can be created by using the ``:annotated:``
|
or between QMP code blocks can be created by using the ``:annotated:``
|
||||||
directive option. When using this option, nested QMP code blocks must
|
directive option. When using this option, nested QMP code blocks must
|
||||||
be entered explicitly with rST's ``::`` syntax.
|
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::
|
For example::
|
||||||
|
|
||||||
# .. qmp-example::
|
# .. qmp-example::
|
||||||
|
@ -1062,10 +1057,20 @@ For example::
|
||||||
# ``arbitrary rST syntax`` in its exposition::
|
# ``arbitrary rST syntax`` in its exposition::
|
||||||
#
|
#
|
||||||
# -> { "execute": "query-block" }
|
# -> { "execute": "query-block" }
|
||||||
# <- { ... }
|
# <- { "return": [
|
||||||
|
# {
|
||||||
|
# "device": "ide0-hd0",
|
||||||
|
# ...
|
||||||
|
# }
|
||||||
|
# ...
|
||||||
|
# ] }
|
||||||
#
|
#
|
||||||
# Above, lengthy output has been omitted for brevity.
|
# 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::
|
Examples of complete definition documentation::
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue