All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Subject: [PULL 06/19] qapi: Implement boxed event argument documentation
Date: Tue, 29 Oct 2019 11:22:15 +0100	[thread overview]
Message-ID: <20191029102228.20740-7-armbru@redhat.com> (raw)
In-Reply-To: <20191029102228.20740-1-armbru@redhat.com>

Generate a reference "Arguments: the members of ...", just like we do
for commands since commit c2dd311cb7 "qapi2texi: Implement boxed
argument documentation".

No change to generated QMP documentation; we don't yet use boxed
events outside tests/.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20191024110237.30963-7-armbru@redhat.com>
---
 tests/qapi-schema/doc-good.texi |  4 +++-
 scripts/qapi/doc.py             | 10 +++++++++-
 tests/qapi-schema/doc-good.json |  1 -
 tests/qapi-schema/doc-good.out  |  2 +-
 4 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/tests/qapi-schema/doc-good.texi b/tests/qapi-schema/doc-good.texi
index 98aa78e1fb..d4b15dabf0 100644
--- a/tests/qapi-schema/doc-good.texi
+++ b/tests/qapi-schema/doc-good.texi
@@ -279,7 +279,9 @@ another feature
 
 @deftypefn Event {} EVT-BOXED
 
-BUG: generated doc misses arguments
+
+
+@b{Arguments:} the members of @code{Object}
 
 @end deftypefn
 
diff --git a/scripts/qapi/doc.py b/scripts/qapi/doc.py
index 6d5726cf6e..f2462c9877 100644
--- a/scripts/qapi/doc.py
+++ b/scripts/qapi/doc.py
@@ -266,9 +266,17 @@ class QAPISchemaGenDocVisitor(QAPISchemaVisitor):
 
     def visit_event(self, name, info, ifcond, arg_type, boxed):
         doc = self.cur_doc
+        if boxed:
+            body = texi_body(doc)
+            body += ('\n@b{Arguments:} the members of @code{%s}\n'
+                     % arg_type.name)
+            body += texi_features(doc)
+            body += texi_sections(doc, ifcond)
+        else:
+            body = texi_entity(doc, 'Arguments', ifcond)
         self._gen.add(MSG_FMT(type='Event',
                               name=doc.symbol,
-                              body=texi_entity(doc, 'Arguments', ifcond)))
+                              body=body))
 
     def symbol(self, doc, entity):
         if self._gen._body:
diff --git a/tests/qapi-schema/doc-good.json b/tests/qapi-schema/doc-good.json
index df50a877e3..d992e713d9 100644
--- a/tests/qapi-schema/doc-good.json
+++ b/tests/qapi-schema/doc-good.json
@@ -160,7 +160,6 @@
 
 ##
 # @EVT-BOXED:
-# BUG: generated doc misses arguments
 ##
 { 'event': 'EVT-BOXED',  'boxed': true,
   'data': 'Object' }
diff --git a/tests/qapi-schema/doc-good.out b/tests/qapi-schema/doc-good.out
index 8cc29fce50..4c9406a464 100644
--- a/tests/qapi-schema/doc-good.out
+++ b/tests/qapi-schema/doc-good.out
@@ -196,4 +196,4 @@ another feature
 <- out
 doc symbol=EVT-BOXED
     body=
-BUG: generated doc misses arguments
+
-- 
2.21.0



  parent reply	other threads:[~2019-10-29 10:39 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-29 10:22 [PULL 00/19] QAPI patches for 2019-10-29 Markus Armbruster
2019-10-29 10:22 ` [PULL 01/19] tests/qapi-schema: Demonstrate feature and enum doc comment bugs Markus Armbruster
2019-10-29 10:22 ` [PULL 02/19] tests/qapi-schema: Demonstrate command and event " Markus Armbruster
2019-10-29 10:22 ` [PULL 03/19] tests/qapi-schema: Cover alternate documentation comments Markus Armbruster
2019-10-29 10:22 ` [PULL 04/19] tests/qapi-schema: Fix feature documentation testing Markus Armbruster
2019-10-29 10:22 ` [PULL 05/19] qemu-doc: Belatedly document QMP command deprecation Markus Armbruster
2019-10-29 10:22 ` Markus Armbruster [this message]
2019-10-29 10:22 ` [PULL 07/19] qapi: De-duplicate entity documentation generation code Markus Armbruster
2019-10-29 10:22 ` [PULL 08/19] qapi: Split .connect_doc(), .check_doc() off .check() Markus Armbruster
2019-10-29 10:22 ` [PULL 09/19] qapi: Fix enum doc comment checking Markus Armbruster
2019-10-29 10:22 ` [PULL 10/19] qapi: Clean up doc comment checking for implicit union base Markus Armbruster
2019-10-29 10:22 ` [PULL 11/19] qapi: Fix doc comment checking for commands and events Markus Armbruster
2019-10-29 10:22 ` [PULL 12/19] qapi: Simplify ._make_implicit_object_type() Markus Armbruster
2019-10-29 10:22 ` [PULL 13/19] qapi: Eliminate .check_doc() overrides Markus Armbruster
2019-10-29 10:22 ` [PULL 14/19] qapi: Fold normalize_if() into check_if() Markus Armbruster
2019-10-29 10:22 ` [PULL 15/19] qapi: Fold normalize_features() into check_features() Markus Armbruster
2019-10-29 10:22 ` [PULL 16/19] qapi: Fold normalize_enum() into check_enum() Markus Armbruster
2019-10-29 10:22 ` [PULL 17/19] qapi: Lift features into QAPISchemaEntity Markus Armbruster
2019-10-29 10:22 ` [PULL 18/19] qapi: Polish reporting of bogus member documentation Markus Armbruster
2019-10-29 10:22 ` [PULL 19/19] qapi: Check feature documentation against the schema Markus Armbruster
2019-10-29 21:08 ` [PULL 00/19] QAPI patches for 2019-10-29 Peter Maydell

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=20191029102228.20740-7-armbru@redhat.com \
    --to=armbru@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.