From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: stefanha@redhat.com, Eric Blake <eblake@redhat.com>
Subject: [PULL 06/11] docs/sphinx/qmp_lexer: Generalize elision syntax
Date: Tue, 8 Apr 2025 09:19:56 +0200 [thread overview]
Message-ID: <20250408072001.2518323-7-armbru@redhat.com> (raw)
In-Reply-To: <20250408072001.2518323-1-armbru@redhat.com>
Accept "... lorem ipsum ..." in addition to "...".
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20250404121413.1743790-7-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
---
docs/devel/qapi-code-gen.rst | 6 ++++--
docs/sphinx/qmp_lexer.py | 2 +-
tests/qapi-schema/doc-good.json | 2 +-
tests/qapi-schema/doc-good.out | 2 +-
tests/qapi-schema/doc-good.txt | 2 +-
5 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/docs/devel/qapi-code-gen.rst b/docs/devel/qapi-code-gen.rst
index 25a46fafb6..231cc0fecf 100644
--- a/docs/devel/qapi-code-gen.rst
+++ b/docs/devel/qapi-code-gen.rst
@@ -1029,7 +1029,9 @@ used.
QMP Examples can be added by using the ``.. qmp-example::`` directive.
In its simplest form, this can be used to contain a single QMP code
block which accepts standard JSON syntax with additional server
-directionality indicators (``->`` and ``<-``), and elisions (``...``).
+directionality indicators (``->`` and ``<-``), and elisions. An
+elision is commonly ``...``, but it can also be or a pair of ``...``
+with text in between.
Optionally, a plaintext title may be provided by using the ``:title:``
directive option. If the title is omitted, the example title will
@@ -1062,7 +1064,7 @@ For example::
# "device": "ide0-hd0",
# ...
# }
- # ...
+ # ... more ...
# ] }
#
# Above, lengthy output has been omitted for brevity.
diff --git a/docs/sphinx/qmp_lexer.py b/docs/sphinx/qmp_lexer.py
index a59de8a079..1bd1b81b70 100644
--- a/docs/sphinx/qmp_lexer.py
+++ b/docs/sphinx/qmp_lexer.py
@@ -24,7 +24,7 @@ class QMPExampleMarkersLexer(RegexLexer):
'root': [
(r'-> ', token.Generic.Prompt),
(r'<- ', token.Generic.Prompt),
- (r' ?\.{3} ?', token.Generic.Prompt),
+ (r'\.{3}( .* \.{3})?', token.Generic.Prompt),
]
}
diff --git a/tests/qapi-schema/doc-good.json b/tests/qapi-schema/doc-good.json
index 0a4f139f83..14b808f909 100644
--- a/tests/qapi-schema/doc-good.json
+++ b/tests/qapi-schema/doc-good.json
@@ -212,7 +212,7 @@
#
# -> "this example"
#
-# <- "has no title"
+# <- ... has no title ...
##
{ 'command': 'cmd-boxed', 'boxed': true,
'data': 'Object',
diff --git a/tests/qapi-schema/doc-good.out b/tests/qapi-schema/doc-good.out
index 5773f1dd6d..dc8352eed4 100644
--- a/tests/qapi-schema/doc-good.out
+++ b/tests/qapi-schema/doc-good.out
@@ -217,7 +217,7 @@ another feature
-> "this example"
- <- "has no title"
+ <- ... has no title ...
doc symbol=EVT_BOXED
body=
diff --git a/tests/qapi-schema/doc-good.txt b/tests/qapi-schema/doc-good.txt
index cb37db606a..17a1d56ef1 100644
--- a/tests/qapi-schema/doc-good.txt
+++ b/tests/qapi-schema/doc-good.txt
@@ -264,7 +264,7 @@ Example::
-> "this example"
- <- "has no title"
+ <- ... has no title ...
"EVT_BOXED" (Event)
--
2.48.1
next prev parent reply other threads:[~2025-04-08 7:20 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-08 7:19 [PULL 00/11] QAPI patches patches for 2025-04-08 Markus Armbruster
2025-04-08 7:19 ` [PULL 01/11] docs/devel/qapi-code-gen: Tidy up whitespace Markus Armbruster
2025-04-08 7:19 ` [PULL 02/11] qapi/rocker: Tidy up query-rocker-of-dpa-flows example Markus Armbruster
2025-04-08 7:19 ` [PULL 03/11] docs/interop: Delete "QEMU Guest Agent Protocol Reference" TOC Markus Armbruster
2025-04-08 7:19 ` [PULL 04/11] docs/interop: Sanitize QMP reference manuals TOC Markus Armbruster
2025-04-08 7:19 ` [PULL 05/11] docs/devel/qapi-code-gen: Improve the part on qmp-example directive Markus Armbruster
2025-04-08 7:19 ` Markus Armbruster [this message]
2025-04-08 7:19 ` [PULL 07/11] docs/sphinx/qmp_lexer: Highlight elisions like comments, not prompts Markus Armbruster
2025-04-08 7:19 ` [PULL 08/11] qapi/qapi-schema: Update introduction for example notation Markus Armbruster
2025-04-08 7:19 ` [PULL 09/11] qapi/qapi-schema: Address the introduction's bit rot Markus Armbruster
2025-04-08 7:20 ` [PULL 10/11] storage-daemon/qapi/qapi-schema: Add a proper introduction Markus Armbruster
2025-04-08 7:20 ` [PULL 11/11] qga/qapi-schema: " Markus Armbruster
2025-04-08 7:45 ` [PULL 00/11] QAPI patches patches for 2025-04-08 Markus Armbruster
2025-04-09 8:31 ` Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250408072001.2518323-7-armbru@redhat.com \
--to=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).