qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: mdroth@linux.vnet.ibm.com, marcandre.lureau@redhat.com,
	eblake@redhat.com
Subject: [Qemu-devel] [RFC PATCH 06/32] qapi2texi: Drop | example markup
Date: Mon,  2 Oct 2017 17:25:26 +0200	[thread overview]
Message-ID: <20171002152552.27999-7-armbru@redhat.com> (raw)
In-Reply-To: <20171002152552.27999-1-armbru@redhat.com>

Doc comment lines starting with '|' are examples.  qapi2texi.py puts
each line in its own @example environment, which is wrong.
Fortunately, this kind of example markup is used in just one place
outside tests.  Replace it by Texinfo markup, and drop the '|'
feature.

tests/qapi-schema/doc-good.texi changes, because unlike the '|'
markup, !texinfo terminates lists.  See the FIXME in texi_format().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 docs/devel/qapi-code-gen.txt    | 10 ----------
 qapi-schema.json                |  8 ++++++--
 scripts/qapi2texi.py            |  9 +--------
 tests/qapi-schema/doc-good.json |  8 ++++++--
 tests/qapi-schema/doc-good.out  |  8 ++++++--
 tests/qapi-schema/doc-good.texi | 10 +++-------
 6 files changed, 22 insertions(+), 31 deletions(-)

diff --git a/docs/devel/qapi-code-gen.txt b/docs/devel/qapi-code-gen.txt
index 0334ef37ef..579807f6a5 100644
--- a/docs/devel/qapi-code-gen.txt
+++ b/docs/devel/qapi-code-gen.txt
@@ -65,11 +65,6 @@ Double the '=' for a subsection title:
 
     # == Subection title
 
-'|' denotes examples:
-
-    # | Text of the example, may span
-    # | multiple lines
-
 '*' starts an itemized list:
 
     # * First item, may span
@@ -110,11 +105,6 @@ Example:
 # 1. with a list
 # 2. like that
 #
-# And some code:
-# | $ echo foo
-# | -> do this
-# | <- get that
-#
 # Texinfo markup:
 # !texinfo
 # @table @samp
diff --git a/qapi-schema.json b/qapi-schema.json
index 3490a5edaf..a6ef550fd5 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -20,8 +20,12 @@
 #
 # Example:
 #
-# | -> data issued by the Client
-# | <- Server data response
+# !texinfo
+# @verbatim
+# -> data issued by the Client
+# <- Server data response
+# @end verbatim
+# !end texinfo
 #
 # Please, refer to the QMP specification (docs/interop/qmp-spec.txt) for
 # detailed information on the Server command and response formats.
diff --git a/scripts/qapi2texi.py b/scripts/qapi2texi.py
index e356f911bb..bfd1c676e1 100755
--- a/scripts/qapi2texi.py
+++ b/scripts/qapi2texi.py
@@ -25,11 +25,6 @@ TYPE_FMT = """
 
 """.format
 
-EXAMPLE_FMT = """@example
-{code}
-@end example
-""".format
-
 
 def subst_strong(doc):
     """Replaces *foo* by @strong{foo}"""
@@ -103,9 +98,7 @@ def texi_format(doc):
         #
         # Make sure to update section "Documentation markup" in
         # docs/devel/qapi-code-gen.txt when fixing this.
-        if line.startswith('| '):
-            line = EXAMPLE_FMT(code=line[2:])
-        elif line.startswith('= '):
+        if line.startswith('= '):
             line = '@section ' + line[2:]
         elif line.startswith('== '):
             line = '@subsection ' + line[3:]
diff --git a/tests/qapi-schema/doc-good.json b/tests/qapi-schema/doc-good.json
index 5fcca8dc85..d3ddf828ef 100644
--- a/tests/qapi-schema/doc-good.json
+++ b/tests/qapi-schema/doc-good.json
@@ -28,8 +28,12 @@
 #
 # - another item
 #
-# | example
-# | multiple lines
+# !texinfo
+# @verbatim
+# example
+# multiple lines
+# @end verbatim
+# !end texinfo
 #
 # !texinfo
 # @table @samp
diff --git a/tests/qapi-schema/doc-good.out b/tests/qapi-schema/doc-good.out
index 7c4aecbaa2..f0ba51db4b 100644
--- a/tests/qapi-schema/doc-good.out
+++ b/tests/qapi-schema/doc-good.out
@@ -56,8 +56,12 @@ is numbered
 
 - another item
 
-| example
-| multiple lines
+!texinfo
+@verbatim
+example
+multiple lines
+@end verbatim
+!end texinfo
 
 !texinfo
 @table @samp
diff --git a/tests/qapi-schema/doc-good.texi b/tests/qapi-schema/doc-good.texi
index b7171ff6d1..4a9162c2a2 100644
--- a/tests/qapi-schema/doc-good.texi
+++ b/tests/qapi-schema/doc-good.texi
@@ -35,13 +35,11 @@ is numbered
 @item
 another item
 
-@example
+@verbatim
 example
-@end example
-
-@example
 multiple lines
-@end example
+@end verbatim
+@end enumerate
 
 
 @table @samp
@@ -52,8 +50,6 @@ This is the text for
 @item bar
 Text for @samp{bar}.
 @end table
-@end enumerate
-
 
 Returns: the King
 Since: the first age
-- 
2.13.6

  parent reply	other threads:[~2017-10-02 15:26 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-02 15:25 [Qemu-devel] [RFC PATCH 00/32] Command line QAPIfication Markus Armbruster
2017-10-02 15:25 ` [Qemu-devel] [RFC PATCH 01/32] tests/qapi-schema: Improve coverage of '@' Markus Armbruster
2017-10-04 10:37   ` Marc-André Lureau
2017-10-02 15:25 ` [Qemu-devel] [RFC PATCH 02/32] texi2pod: Support @verbatim environment Markus Armbruster
2017-10-05 14:58   ` Eric Blake
2017-10-06  5:24     ` Markus Armbruster
2017-10-06 13:40       ` Eric Blake
2017-10-02 15:25 ` [Qemu-devel] [RFC PATCH 03/32] qapi2texi: Fix for examples containing '@' Markus Armbruster
2017-10-04 10:45   ` Marc-André Lureau
2017-10-02 15:25 ` [Qemu-devel] [RFC PATCH 04/32] qapi2texi: Fix for '@' not followed by \w character Markus Armbruster
2017-10-04 10:47   ` Marc-André Lureau
2017-10-02 15:25 ` [Qemu-devel] [RFC PATCH 05/32] qapi2texi: Provide access to Texinfo markup Markus Armbruster
2017-10-02 15:25 ` Markus Armbruster [this message]
2017-10-02 15:25 ` [Qemu-devel] [RFC PATCH 07/32] qapi: Drop superfluous allow_optional=True Markus Armbruster
2017-10-04 10:52   ` Marc-André Lureau
2017-10-02 15:25 ` [Qemu-devel] [RFC PATCH 08/32] qapi: Simplify check_name() parameters Markus Armbruster
2017-10-04 10:54   ` Marc-André Lureau
2017-10-04 10:54   ` Marc-André Lureau
2017-10-02 15:25 ` [Qemu-devel] [RFC PATCH 09/32] qapi: check_type() parameter allow_optional is now unused, drop Markus Armbruster
2017-10-04 10:55   ` Marc-André Lureau
2017-10-02 15:25 ` [Qemu-devel] [RFC PATCH 10/32] qapi: Don't run generators twice Markus Armbruster
2017-10-04 11:04   ` Marc-André Lureau
2017-10-02 15:25 ` [Qemu-devel] [RFC PATCH 11/32] qapi: Drop the options to generate only .c or .h Markus Armbruster
2017-10-04 11:07   ` Marc-André Lureau
2017-10-02 15:25 ` [Qemu-devel] [RFC PATCH 12/32] qapi: Use argparse to parse command line arguments Markus Armbruster
2017-10-04 11:13   ` Marc-André Lureau
2017-10-02 15:25 ` [Qemu-devel] [RFC PATCH 13/32] qapi: Use argparse to open schema file Markus Armbruster
2017-10-04 11:18   ` Marc-André Lureau
2017-10-02 15:25 ` [Qemu-devel] [RFC PATCH 14/32] qapi: Rework generated code for built-in types Markus Armbruster
2017-10-04 11:52   ` Marc-André Lureau
2017-10-05  4:24     ` Markus Armbruster
2017-10-02 15:25 ` [Qemu-devel] [RFC PATCH 15/32] tests/qapi-schema: Improve simple union coverage Markus Armbruster
2017-10-04 12:02   ` Marc-André Lureau
2017-10-05  4:29     ` Markus Armbruster
2017-10-02 15:25 ` [Qemu-devel] [RFC PATCH 16/32] qapi: Factor out _make_implicit_wrapper_type() Markus Armbruster
2017-10-04 12:00   ` Marc-André Lureau
2017-10-02 15:25 ` [Qemu-devel] [RFC PATCH 17/32] qapi: Fix simple union lowering with multiple schemas Markus Armbruster
2017-10-04 12:04   ` Marc-André Lureau
2017-10-02 15:25 ` [Qemu-devel] [RFC PATCH 18/32] docs/devel/qapi-code-gen.txt: Rewrite section on schema syntax Markus Armbruster
2017-10-04 11:59   ` Marc-André Lureau
2017-10-02 15:25 ` [Qemu-devel] [RFC PATCH 19/32] qapi: Accept double-quoted strings Markus Armbruster
2017-10-04 11:58   ` Marc-André Lureau
2017-10-05  4:41     ` Markus Armbruster
2017-10-05 14:13       ` Marc-André Lureau
2017-10-06  5:29         ` Markus Armbruster
2017-10-05 15:16       ` Eric Blake
2017-10-06  5:27         ` Markus Armbruster
2017-10-02 15:25 ` [Qemu-devel] [RFC PATCH 20/32] qapi: Frontend for defining command line options Markus Armbruster
2017-10-02 15:25 ` [Qemu-devel] [RFC PATCH 21/32] qapi: Define QAPIOptionKind and QAPIOption automatically Markus Armbruster
2017-10-02 15:25 ` [Qemu-devel] [RFC PATCH 22/32] qapi: New helper c_string() Markus Armbruster
2017-10-02 15:25 ` [Qemu-devel] [RFC PATCH 23/32] qapi-options: Command line option backend Markus Armbruster
2017-10-02 15:25 ` [Qemu-devel] [RFC PATCH 24/32] qapi-options: Generate help string Markus Armbruster
2017-10-02 15:25 ` [Qemu-devel] [RFC PATCH 25/32] qapi-introspect: Include command line options information Markus Armbruster
2017-10-02 15:25 ` [Qemu-devel] [RFC PATCH 26/32] qapi2texi: " Markus Armbruster
2017-10-02 15:25 ` [Qemu-devel] [RFC PATCH 27/32] os-posix: Drop misleading comment Markus Armbruster
2017-10-04 12:10   ` Marc-André Lureau
2017-10-02 15:25 ` [Qemu-devel] [RFC PATCH 28/32] vl: QAPIfy command line option definition Markus Armbruster
2017-10-02 15:25 ` [Qemu-devel] [RFC PATCH 29/32] qapi/options: QAPIfy --echr argument type Markus Armbruster
2017-10-02 15:25 ` [Qemu-devel] [RFC PATCH 30/32] qapi/options: QAPIfy --watchdog-action " Markus Armbruster
2017-10-02 15:25 ` [Qemu-devel] [RFC PATCH 31/32] qapi/options: QAPIfy --blockdev " Markus Armbruster
2017-10-02 15:25 ` [Qemu-devel] [RFC PATCH 32/32] qapi/options: QAPIfy --add-fd " Markus Armbruster

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=20171002152552.27999-7-armbru@redhat.com \
    --to=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /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).