From patchwork Tue Oct 29 10:22:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 11217661 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 28BB71390 for ; Tue, 29 Oct 2019 10:38:51 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F21FA20874 for ; Tue, 29 Oct 2019 10:38:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="VmMdHaJz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F21FA20874 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:54562 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iPOtm-00077N-2h for patchwork-qemu-devel@patchwork.kernel.org; Tue, 29 Oct 2019 06:38:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56909) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iPOeI-0005cy-Jq for qemu-devel@nongnu.org; Tue, 29 Oct 2019 06:22:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iPOeH-0001IZ-D5 for qemu-devel@nongnu.org; Tue, 29 Oct 2019 06:22:50 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:27733 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iPOeH-0001IJ-98 for qemu-devel@nongnu.org; Tue, 29 Oct 2019 06:22:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572344569; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tc3I4EWEVU2b+QWt9klfeULkPE0QaiDiPfz84BGDzhs=; b=VmMdHaJzHH5H5P1FUCAVCnsJkeXpHbFgMTkVezoKGzBayP1n4CbYNmnjp/m6WVljl85jwa Aj7vfMwzhPaunzJXGqApgiKQjrF8sd305StM/p6acSuqQNJLUvBqJFZEYpq8PIT9+hzqRG oU4kCecMi5LEyr6n7JhqWufrcOTCkI0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-239-VsRzaGOqM1yE4vtLih2C9g-1; Tue, 29 Oct 2019 06:22:47 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 00A8F1005509 for ; Tue, 29 Oct 2019 10:22:47 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.36.118.123]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C3BC260C4B for ; Tue, 29 Oct 2019 10:22:46 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 8F9891132C11; Tue, 29 Oct 2019 11:22:28 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PULL 06/19] qapi: Implement boxed event argument documentation Date: Tue, 29 Oct 2019 11:22:15 +0100 Message-Id: <20191029102228.20740-7-armbru@redhat.com> In-Reply-To: <20191029102228.20740-1-armbru@redhat.com> References: <20191029102228.20740-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: VsRzaGOqM1yE4vtLih2C9g-1 X-Mimecast-Spam-Score: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" 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 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 +