[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL for 2.9 12/49] qapi2texi: Fix up output around #optio
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] [PULL for 2.9 12/49] qapi2texi: Fix up output around #optional |
Date: |
Thu, 16 Mar 2017 07:27:28 +0100 |
We use tag #optional to mark optional members, like this:
# @name: #optional The name of the guest
texi_body() strips #optional, but not whitespace around it. For the
above, we get in qemu-qmp-qapi.texi
@item @code{'name'} (optional)
The name of the guest
@end table
The extra space can lead to artifacts in output, e.g in
qemu-qmp-ref.7.pod
=item C<'name'> (optional)
The name of the guest
and then in qemu-qmp-ref.7
.IX Item "name (optional)"
.Vb 1
\& The name of the guest
.Ve
instead of intended plain
.IX Item "name (optional)"
The name of the guest
Get rid of these artifacts by removing whitespace around #optional
along with it.
This turns three minus signs in qapi-schema.json into markup, because
they're now at the beginning of the line. Drop them, they're unwanted
there.
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>
---
qapi-schema.json | 6 +++---
scripts/qapi2texi.py | 3 ++-
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/qapi-schema.json b/qapi-schema.json
index 17c766e..52141cd 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -3779,11 +3779,11 @@
#
# @dstport: #optional destination port - mandatory for udp, optional for ip
#
-# @ipv6: #optional - force the use of ipv6
+# @ipv6: #optional force the use of ipv6
#
-# @udp: #optional - use the udp version of l2tpv3 encapsulation
+# @udp: #optional use the udp version of l2tpv3 encapsulation
#
-# @cookie64: #optional - use 64 bit coookies
+# @cookie64: #optional use 64 bit coookies
#
# @counter: #optional have sequence counter
#
diff --git a/scripts/qapi2texi.py b/scripts/qapi2texi.py
index 06d6abf..0f3e573 100755
--- a/scripts/qapi2texi.py
+++ b/scripts/qapi2texi.py
@@ -137,7 +137,8 @@ def texi_body(doc):
desc = str(section)
opt = ''
if "#optional" in desc:
- desc = desc.replace("#optional", "")
+ desc = re.sub(r'^ *#optional *\n?|\n? *#optional *$|#optional',
+ '', desc)
opt = ' (optional)'
body += "@item @code{'%s'}%s\n%s\n" % (arg, opt,
texi_format(desc))
--
2.7.4
- [Qemu-devel] [PULL for 2.9 00/49] QAPI patches for 2017-03-16, Markus Armbruster, 2017/03/16
- [Qemu-devel] [PULL for 2.9 02/49] qmp: allow setting properties to empty string in qmp-shell, Markus Armbruster, 2017/03/16
- [Qemu-devel] [PULL for 2.9 03/49] qapi: Factor QAPISchemaParser._include() out of .__init__(), Markus Armbruster, 2017/03/16
- [Qemu-devel] [PULL for 2.9 06/49] docs/qapi-code-gen.txt: Drop confusing reference to 'gen', Markus Armbruster, 2017/03/16
- [Qemu-devel] [PULL for 2.9 10/49] tests/qapi-schema: Cover empty union base, Markus Armbruster, 2017/03/16
- [Qemu-devel] [PULL for 2.9 11/49] qapi: Fix to reject empty union base gracefully, Markus Armbruster, 2017/03/16
- [Qemu-devel] [PULL for 2.9 01/49] qapi2texi: change texi formatters, Markus Armbruster, 2017/03/16
- [Qemu-devel] [PULL for 2.9 08/49] qapi: Have each QAPI schema declare its name rule violations, Markus Armbruster, 2017/03/16
- [Qemu-devel] [PULL for 2.9 07/49] qapi: Have each QAPI schema declare its returns white-list, Markus Armbruster, 2017/03/16
- [Qemu-devel] [PULL for 2.9 12/49] qapi2texi: Fix up output around #optional,
Markus Armbruster <=
- [Qemu-devel] [PULL for 2.9 04/49] qapi: Make doc comments optional where we don't need them, Markus Armbruster, 2017/03/16
- [Qemu-devel] [PULL for 2.9 20/49] qapi: Use raw strings for regular expressions consistently, Markus Armbruster, 2017/03/16
- [Qemu-devel] [PULL for 2.9 14/49] qapi/rocker: Fix up doc comment notes on optional members, Markus Armbruster, 2017/03/16
- [Qemu-devel] [PULL for 2.9 09/49] qapi: Clean up build of generated documentation, Markus Armbruster, 2017/03/16
- [Qemu-devel] [PULL for 2.9 27/49] qapi2texi: Include member type in generated documentation, Markus Armbruster, 2017/03/16
- [Qemu-devel] [PULL for 2.9 24/49] qapi2texi: Explain enum value undocumentedness more clearly, Markus Armbruster, 2017/03/16
- [Qemu-devel] [PULL for 2.9 17/49] qapi: Conjure up QAPIDoc.ArgSection for undocumented members, Markus Armbruster, 2017/03/16
- [Qemu-devel] [PULL for 2.9 26/49] qapi2texi: Implement boxed argument documentation, Markus Armbruster, 2017/03/16
- [Qemu-devel] [PULL for 2.9 40/49] qapi: Eliminate check_docs() and drop QAPIDoc.expr, Markus Armbruster, 2017/03/16
- [Qemu-devel] [PULL for 2.9 39/49] qapi: Fix detection of bogus member documentation, Markus Armbruster, 2017/03/16