public inbox for qemu-devel@nongnu.org
 help / color / mirror / Atom feed
From: John Snow <jsnow@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel <qemu-devel@nongnu.org>,
	"Pierrick Bouvier" <pierrick.bouvier@linaro.org>,
	"Lukas Straub" <lukasstraub2@web.de>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Zhao Liu" <zhao1.liu@intel.com>,
	"Jason Wang" <jasowang@redhat.com>,
	"Mauro Carvalho Chehab" <mchehab+huawei@kernel.org>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Peter Xu" <peterx@redhat.com>, "Eric Blake" <eblake@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Fabiano Rosas" <farosas@suse.de>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Cédric Le Goater" <clg@redhat.com>,
	Qemu-block <qemu-block@nongnu.org>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Stefan Berger" <stefanb@linux.vnet.ibm.com>,
	"Alex Williamson" <alex@shazbot.org>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"Kevin Wolf" <kwolf@redhat.com>,
	"Michael Roth" <michael.roth@amd.com>,
	"Stefano Garzarella" <sgarzare@redhat.com>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Igor Mammedov" <imammedo@redhat.com>,
	"Jiri Pirko" <jiri@resnulli.us>,
	"Yanan Wang" <wangyanan55@huawei.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Kashyap Chamarthy" <kchamart@redhat.com>,
	"Hanna Reitz" <hreitz@redhat.com>,
	"Ani Sinha" <anisinha@redhat.com>
Subject: Re: [PATCH 1/8] qapi: differentiate "intro" and "details" sections
Date: Fri, 20 Mar 2026 13:20:59 -0400	[thread overview]
Message-ID: <CAFn=p-b5uJL8uW_zVg6+30xVVO8MXwD=ukFk-H3UCjT7dHia5g@mail.gmail.com> (raw)
In-Reply-To: <87se9u7koi.fsf@pond.sub.org>

[-- Attachment #1: Type: text/plain, Size: 6791 bytes --]

On Fri, Mar 20, 2026, 8:24 AM Markus Armbruster <armbru@redhat.com> wrote:

> John Snow <jsnow@redhat.com> writes:
>
> > This patch begins distinguishing "Plain" sections as being either
> > "Intro" or "Details" sections for the purpose of knowing when/where/how
> > to inline those sections.
> >
> > The Intro section is always the first section of any doc block. It may
> > be empty or any number of paragraphs. It is interrupted by any other
> > non-plaintext section, i.e.; Members, Features, Errors, Returns, Since,
> > and TODO.
> >
> > The details section, when present, is either the last section or the
> > second-to-last section when a "Since:" section is present. It consists
> > of any plain text in the doc block that follows any named sections if
> > present.
> >
> > Signed-off-by: John Snow <jsnow@redhat.com>
>
> The commit message explains what kinds INTRO and DETAILS are, but not
> why they're useful.  My guess:
>

Right, my apologies. Leaning on you having some existing knowledge here,
and also going light on details because the series is still obviously in
flux.

Let me elaborate on the motivations here...


> 1. Represent the future "Details:" marker: the plain section before it
> is of kind INTRO, the one afterwards is of kind DETAILS.
>

Yes.


> 2. Future programming convenience?  With just PLAIN, code may have to
> understand the section's context to make decisions, and with INTRO and
> DETAILS is doesn't.
>
> Guess close enough?
>

Pretty much.

Originally, I thought I'd inline things like this:

Intro (child)
Intro (parent)
...other sections...
Details (parent)
Details (child)

Last time we went over this, you mused that there was likely never a
sufficient reason to actually inline the intro. I recall believing and
accepting this.

So functionally what this does for us is:

(1) Explicitly delineate what comes before the tabular section of the docs
(members, Returns, Errors, features) and what comes after.

(2) Explicitly defines what will not be inlined.


> The commit message covers PLAIN sections at the beginning and at the end
> (modulo Since:).  It doesn't cover PLAIN sections between tagged
> sections / member descriptions.  You disallow these in PATCH 2.  You can
> either cover them here, or get rid of them by swapping PATCH 1 and 2.
>

Sure. For now they're separated just to separate concerns in review, but if
you believe both should be all-at-once, that's fine too. I think there's
not a regression by separating it, though. It's just a semantic change from
details meaning "anything after the intro" to "specifically the closing
section". The intermediate meaning exists for only one patch.


> Hmm, is your description of DETAILS accurate?  Looks like it isn't; see
> my review of tests/qapi-schema/doc-good.out below.
>

Whoops, future-think. It winds up being true, but isn't true yet as of this
commit. Well, almost. See below.


> > ---
> >  docs/sphinx/qapidoc.py         |  2 +-
> >  scripts/qapi/parser.py         | 35 +++++++++++++++++++++++-----------
> >  tests/qapi-schema/doc-good.out |  8 ++++----
> >  3 files changed, 29 insertions(+), 16 deletions(-)
>
> [Skipping the Python code in my first pass...]
>
> > diff --git a/tests/qapi-schema/doc-good.out
> b/tests/qapi-schema/doc-good.out
> > index 04a55072646..04e29e8d50f 100644
> > --- a/tests/qapi-schema/doc-good.out
> > +++ b/tests/qapi-schema/doc-good.out
> > @@ -116,7 +116,7 @@ The _one_ {and only}, description on the same line
> >  Also _one_ {and only}
> >      feature=enum-member-feat
> >  a member feature
> > -    section=Plain
> > +    section=Details
> >  @two is undocumented
>
> The section containing "@two is undocumented" changes from PLAIN to
> DETAILS.  Doc source:
>
>     ##
>     # @Enum:
>     #
>     # @one: The _one_ {and only}, description on the same line
>     #
>     # Features:
>     # @enum-feat: Also _one_ {and only}
>     # @enum-member-feat: a member feature
>     #
>     # @two is undocumented
>     ##
>
> It is at the end.  Good.
>
> >  doc symbol=Base
> >      body=
> > @@ -175,7 +175,7 @@ description starts on the same line
> >  a feature
> >      feature=cmd-feat2
> >  another feature
> > -    section=Plain
> > +    section=Details
> >  .. note:: @arg3 is undocumented
>
> The section containing "@arg3 is undocumented" changes from PLAIN to
> DETAILS.  Doc source:
>
> Doc source:
>
>     ##
>     # @cmd:
>     #
>     # @arg1:
>     #     description starts on a new line,
>     #     indented
>     #
>     # @arg2: description starts on the same line
>     #     remainder indented differently
>     #
>     # Returns: @Object
>     #
>     # Errors: some
>     #
>     # Features:
>     # @cmd-feat1: a feature
>     # @cmd-feat2: another feature
>     #
>     # .. note:: @arg3 is undocumented
>     #
>     # TODO: frobnicate
>     #
>
> It is *not* at the end.  Is the commit message inaccurate?
>

Ah. I wasn't considering TODO... Since it is a comment I mentally elided it.

What I mean to say is that Details is (will be) essentially the last
content section that is actually rendered.

In the HTML, it will always be last if present because both TODO and Since
are actually entirely removed from the flow of the document.

Though as we both point out, what i write is not technically true here. (It
can currently be an intermediate section AND Since is not the only section
that may follow it.)


> >      section=Returns
> >  @Object
> > @@ -183,7 +183,7 @@ another feature
> >  some
> >      section=Todo
> >  frobnicate
> > -    section=Plain
> > +    section=Details
> >  .. admonition:: Notes
> >
> >   - Lorem ipsum dolor sit amet
>     - Ut enim ad minim veniam
>
>     [some section body text elided for brevity...]
>
>    Note::
>        Ceci n'est pas une note
>        section=Since
>    2.10
>
> The section starting with the adminition and ending after "Ceci n'est
> pas une note" changes from PLAIN to DETAILS.  Doc source continued:
>
>     # .. admonition:: Notes
>     #
>     #  - Lorem ipsum dolor sit amet
>     #  - Ut enim ad minim veniam
>     #
>     [same text elided...]
>     #
>     # Note::
>     #     Ceci n'est pas une note
>     #
>     # Since: 2.10
>     ##
>
> It is second-to-last, and the last section is SINCE.  Good.
>
> > @@ -216,7 +216,7 @@ If you're bored enough to read this, go see a video
> of boxed cats
> >  a feature
> >      featurec=md-feat2
> >  another feature
> > -    section=Plain
> > +    section=Details
> >  .. qmp-example::
> >
> >     -> "this example"
>
> This one is also at the end.  Good.
>
>

[-- Attachment #2: Type: text/html, Size: 10222 bytes --]

  reply	other threads:[~2026-03-20 17:22 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-16 18:25 [PATCH 0/8] qapi: enforce section ordering John Snow
2026-03-16 18:26 ` [PATCH 1/8] qapi: differentiate "intro" and "details" sections John Snow
2026-03-20 12:24   ` Markus Armbruster
2026-03-20 17:20     ` John Snow [this message]
2026-03-23  8:15       ` Markus Armbruster
2026-03-16 18:26 ` [PATCH 2/8] qapi: prohibit 'details' sections between tagged sections John Snow
2026-03-20 12:46   ` Markus Armbruster
2026-03-20 17:40     ` John Snow
2026-03-23  8:41       ` Markus Armbruster
2026-03-20 13:46   ` Markus Armbruster
2026-03-20 17:42     ` John Snow
2026-03-16 18:26 ` [PATCH 3/8] qapi: add "Details:" disambiguation marker John Snow
2026-03-20 13:45   ` Markus Armbruster
2026-03-20 18:25     ` John Snow
2026-03-23  8:55       ` Markus Armbruster
2026-03-16 18:26 ` [PATCH 4/8] qapi: detect potentially semantically ambiguous intro paragraphs John Snow
2026-03-20 13:51   ` Markus Armbruster
2026-03-20 18:26     ` John Snow
2026-03-16 18:26 ` [PATCH 5/8] qapi: re-order QAPI doc block sections John Snow
2026-03-20 14:11   ` Markus Armbruster
2026-03-20 18:27     ` John Snow
2026-03-16 18:26 ` [PATCH 6/8] qapi: enforce doc block section ordering John Snow
2026-03-20 14:13   ` Markus Armbruster
2026-03-20 18:28     ` John Snow
2026-03-23  8:56       ` Markus Armbruster
2026-03-16 18:26 ` [PATCH 7/8] qapi: re-order 'since' sections to always be last John Snow
2026-03-20 14:23   ` Markus Armbruster
2026-03-20 20:47     ` John Snow
2026-03-16 18:26 ` [PATCH 8/8] qapi: enforce strict positioning for "Since:" section John Snow

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='CAFn=p-b5uJL8uW_zVg6+30xVVO8MXwD=ukFk-H3UCjT7dHia5g@mail.gmail.com' \
    --to=jsnow@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=alex@shazbot.org \
    --cc=anisinha@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=clg@redhat.com \
    --cc=eblake@redhat.com \
    --cc=farosas@suse.de \
    --cc=hreitz@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=jiri@resnulli.us \
    --cc=kchamart@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=lukasstraub2@web.de \
    --cc=marcandre.lureau@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mchehab+huawei@kernel.org \
    --cc=michael.roth@amd.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=peterx@redhat.com \
    --cc=philmd@linaro.org \
    --cc=pierrick.bouvier@linaro.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=sgarzare@redhat.com \
    --cc=stefanb@linux.vnet.ibm.com \
    --cc=stefanha@redhat.com \
    --cc=wangyanan55@huawei.com \
    --cc=zhao1.liu@intel.com \
    /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