From patchwork Wed Jul 17 02:13:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Snow X-Patchwork-Id: 13735023 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 59F82C3DA59 for ; Wed, 17 Jul 2024 02:14:30 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sTuAp-0007vD-5K; Tue, 16 Jul 2024 22:13:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sTuAj-0007uI-QX for qemu-devel@nongnu.org; Tue, 16 Jul 2024 22:13:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sTuAg-0003Ok-E3 for qemu-devel@nongnu.org; Tue, 16 Jul 2024 22:13:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721182412; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fpRV929kmfNC8JJGtecvN9j+uR69f4Qs7o0Dmezllb8=; b=VRjeezgxPAdJpJ/FAlMcmLYr/oTq+Pk0xswzx/ODJ1jMUuNHuVQcj8TNmhGA2m4J3Pky55 7xXQemcVFey8mrvY6dvwIMyjRTWmuEmQGkISPDDkcDZILKP1UEzbpj0wZxYutOr/SdaXyK dcN25hal2Zh06w8JYrAMBJiHrJp4Vvo= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-36-EILglWi4M9m7-vapnmKiIQ-1; Tue, 16 Jul 2024 22:13:25 -0400 X-MC-Unique: EILglWi4M9m7-vapnmKiIQ-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 92C241956046; Wed, 17 Jul 2024 02:13:21 +0000 (UTC) Received: from scv.localdomain (unknown [10.22.65.127]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1F99D1955F40; Wed, 17 Jul 2024 02:13:12 +0000 (UTC) From: John Snow To: qemu-devel@nongnu.org Cc: =?utf-8?q?C=C3=A9dric_Le_Goater?= , Kevin Wolf , Fabiano Rosas , =?utf-8?q?D?= =?utf-8?q?aniel_P=2E_Berrang=C3=A9?= , Peter Xu , Jason Wang , Igor Mammedov , qemu-block@nongnu.org, Lukas Straub , Paolo Bonzini , Peter Maydell , Eric Blake , Markus Armbruster , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Jiri Pirko , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Mads Ynddal , Stefan Berger , Pavel Dovgalyuk , Michael Roth , Stefan Hajnoczi , Alex Williamson , Yanan Wang , Eduardo Habkost , Ani Sinha , Marcel Apfelbaum , "Michael S. Tsirkin" , Hanna Reitz , John Snow Subject: [PATCH v2 0/9] qapi: convert example sections to qmp-example rST directives Date: Tue, 16 Jul 2024 22:13:02 -0400 Message-ID: <20240717021312.606116-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass client-ip=170.10.133.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org This patchset focuses on converting example sections to rST directives using a new `.. qmp-example::` directive. V2: - Rebased on origin/master; converted one more example - Fixed (most?) minor nits from last review - Didn't address lack of newline in text mode or enhanced lexer (yet) Changes since this was split out from the prior series: - Harmonie updated the CSS for the example block section. I think it's really tidy now! Thanks Harmonie! - Dependence on SphinxDirective was removed, but it will likely re-appear in the next series anyway. - qapi-code-gen.rst was updated with a section on how to write examples. - Various minor tweaks to comments, commit messages, docs, etc. Harmonie Snow (1): docs/sphinx: add CSS styling for qmp-example directive John Snow (8): [DO-NOT-MERGE]: Add some ad-hoc linting helpers. docs/qapidoc: factor out do_parse() docs/qapidoc: create qmp-example directive docs/qapidoc: add QMP highlighting to annotated qmp-example blocks qapi: convert "Example" sections without titles qapi: convert "Example" sections with titles qapi: convert "Example" sections with longer prose qapi: remove "Example" doc section docs/devel/qapi-code-gen.rst | 58 +++++++++-- docs/sphinx-static/theme_overrides.css | 49 ++++++++++ docs/sphinx/qapidoc.py | 130 ++++++++++++++++++++++--- qapi/acpi.json | 4 +- qapi/block-core.json | 88 +++++++++-------- qapi/block.json | 57 ++++++----- qapi/char.json | 24 +++-- qapi/control.json | 8 +- qapi/dump.json | 8 +- qapi/machine-target.json | 2 +- qapi/machine.json | 68 +++++++------ qapi/migration.json | 90 +++++++++-------- qapi/misc-target.json | 22 ++--- qapi/misc.json | 32 +++--- qapi/net.json | 22 +++-- qapi/pci.json | 2 +- qapi/qdev.json | 10 +- qapi/qom.json | 16 +-- qapi/replay.json | 8 +- qapi/rocker.json | 8 +- qapi/run-state.json | 32 +++--- qapi/tpm.json | 6 +- qapi/trace.json | 4 +- qapi/transaction.json | 2 +- qapi/ui.json | 45 ++++----- qapi/vfio.json | 2 +- qapi/virtio.json | 45 ++++++--- qapi/yank.json | 4 +- scripts/qapi-lint.sh | 61 ++++++++++++ scripts/qapi/Makefile | 5 + scripts/qapi/parser.py | 10 +- tests/qapi-schema/doc-good.json | 19 ++-- tests/qapi-schema/doc-good.out | 26 +++-- tests/qapi-schema/doc-good.txt | 23 ++--- 34 files changed, 662 insertions(+), 328 deletions(-) create mode 100755 scripts/qapi-lint.sh create mode 100644 scripts/qapi/Makefile