Skip to content

Commit e27608d

Browse files
author
Markus Armbruster
committed
docs/devel/qapi-code-gen: Improve the part on qmp-example directive
Signed-off-by: Markus Armbruster <[email protected]> Message-ID: <[email protected]> Reviewed-by: Eric Blake <[email protected]>
1 parent 0d4c7ea commit e27608d

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

docs/devel/qapi-code-gen.rst

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,20 +1038,15 @@ default to "Example:".
10381038
A simple QMP example::
10391039

10401040
# .. qmp-example::
1041-
# :title: Using query-block
10421041
#
1043-
# -> { "execute": "query-block" }
1044-
# <- { ... }
1042+
# -> { "execute": "query-name" }
1043+
# <- { "return": { "name": "Fred" } }
10451044

10461045
More complex or multi-step examples where exposition is needed before
10471046
or between QMP code blocks can be created by using the ``:annotated:``
10481047
directive option. When using this option, nested QMP code blocks must
10491048
be entered explicitly with rST's ``::`` syntax.
10501049

1051-
Highlighting in non-QMP languages can be accomplished by using the
1052-
``.. code-block:: lang`` directive, and non-highlighted text can be
1053-
achieved by omitting the language argument.
1054-
10551050
For example::
10561051

10571052
# .. qmp-example::
@@ -1061,11 +1056,21 @@ For example::
10611056
# This is a more complex example that can use
10621057
# ``arbitrary rST syntax`` in its exposition::
10631058
#
1064-
# -> { "execute": "query-block" }
1065-
# <- { ... }
1059+
# -> { "execute": "query-block" }
1060+
# <- { "return": [
1061+
# {
1062+
# "device": "ide0-hd0",
1063+
# ...
1064+
# }
1065+
# ...
1066+
# ] }
10661067
#
10671068
# Above, lengthy output has been omitted for brevity.
10681069

1070+
Highlighting in non-QMP languages can be accomplished by using the
1071+
``.. code-block:: lang`` directive, and non-highlighted text can be
1072+
achieved by omitting the language argument.
1073+
10691074

10701075
Examples of complete definition documentation::
10711076

0 commit comments

Comments
 (0)