From patchwork Mon Oct 2 15:25:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 820569 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@gnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y5R4G4LZ0z9t6m for ; Tue, 3 Oct 2017 02:32:30 +1100 (AEDT) Received: from localhost ([::1]:52846 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dz2ho-0004SY-JA for incoming@patchwork.ozlabs.org; Mon, 02 Oct 2017 11:32:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38640) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dz2bZ-0007x9-MB for qemu-devel@nongnu.org; Mon, 02 Oct 2017 11:26:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dz2bY-0007tV-Js for qemu-devel@nongnu.org; Mon, 02 Oct 2017 11:26:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49033) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dz2bY-0007sr-Bc for qemu-devel@nongnu.org; Mon, 02 Oct 2017 11:26:00 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 71472820F4; Mon, 2 Oct 2017 15:25:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 71472820F4 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=armbru@redhat.com Received: from blackfin.pond.sub.org (ovpn-116-91.ams2.redhat.com [10.36.116.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 04ABB5D720; Mon, 2 Oct 2017 15:25:58 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 94BBC1156270; Mon, 2 Oct 2017 17:25:52 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Mon, 2 Oct 2017 17:25:26 +0200 Message-Id: <20171002152552.27999-7-armbru@redhat.com> In-Reply-To: <20171002152552.27999-1-armbru@redhat.com> References: <20171002152552.27999-1-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 02 Oct 2017 15:25:59 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [RFC PATCH 06/32] qapi2texi: Drop | example markup X-BeenThere: qemu-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: marcandre.lureau@redhat.com, mdroth@linux.vnet.ibm.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@gnu.org Sender: "Qemu-devel" 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 --- 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