From: John Snow <jsnow@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org, "Peter Maydell" <peter.maydell@linaro.org>,
"Thomas Huth" <thuth@redhat.com>,
"Yanan Wang" <wangyanan55@huawei.com>,
"Fabiano Rosas" <farosas@suse.de>,
"Zhao Liu" <zhao1.liu@intel.com>,
"Lukas Straub" <lukasstraub2@web.de>,
"Eduardo Habkost" <eduardo@habkost.net>,
"Michael Roth" <michael.roth@amd.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Peter Xu" <peterx@redhat.com>, "Eric Blake" <eblake@redhat.com>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Jason Wang" <jasowang@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: [PATCH 00/42] docs: add sphinx-domain rST generator to qapidoc
Date: Fri, 21 Feb 2025 13:08:10 -0500 [thread overview]
Message-ID: <CAFn=p-aG38tqxue2ZvHP_9LEyWXXxawd=SCuOJNptNKOihONUg@mail.gmail.com> (raw)
In-Reply-To: <87o6yvn6iy.fsf@pond.sub.org>
[-- Attachment #1: Type: text/plain, Size: 9794 bytes --]
On Fri, Feb 21, 2025 at 1:42 AM Markus Armbruster <armbru@redhat.com> wrote:
> John Snow <jsnow@redhat.com> writes:
>
> > On Wed, Feb 19, 2025 at 8:22 AM Markus Armbruster <armbru@redhat.com>
> wrote:
> >
> >> John Snow <jsnow@redhat.com> writes:
> >>
> >> > "The text handler you add looks just like the existing latex handler.
> Does
> >> > LaTeX output lack "little headings", too?"
> >> >
> >> > Yes, almost certainly. Can you let me know which output formats we
> actually
> >> > "care about"? I'll have to test them all.
> >>
> >> As far as I can tell, our build system runs sphinx-build -b html and -b
> >> man.
> >>
> >> I run it with -b text manually all the time to hunt for and review
> >> changes in output. I'd prefer to keep it working if practical.
> >>
> >> For what it's worth, there is a bit of LaTeX configuration in
> >> docs/conf.py.
> >>
> >> > In the meantime, I upgraded
> my
> >> > patch so that the text translator properly handles branches with
> headings
> >> > that delineate the different branches so that the text output is fully
> >> > reasonable. I will need to do the same for any format we care about.
> >> >
> >> > I've re-pushed as of "about 30 minutes before I wrote this email" --
> >> > https://gitlab.com/jsnow/qemu/-/commits/sphinx-domain-blergh2
> >> >
> >> > This branch includes the text generator fixes (which technically
> belong
> >> > with the predecessor series we skipped, but I'll refactor that later.)
> >> > it also includes fixes to the branch inliner, generated return
> statements,
> >> > and generated out-of-band feature sections.
> >>
> >> I'll fetch it, thanks!
> >>
> >> > (Long story short: inserting new sections in certain spots was broken
> >> > because of cache. Oops. We can discuss more why I wrote that part of
> the
> >> > code like I did in review for the patch that introduced that problem.
> It's
> >> > the "basic inliner" patch.)
> >> >
> >> > Below, I'm going to try a new communication approach where I
> explicitly say
> >> > if I have added something to my tasklist or not so that it's clear to
> you
> >> > what I believe is actionable (and what I am agreeing to change) and
> what I
> >> > believe needs stronger input from you before I do anything. Apologies
> if it
> >> > seems a little robotic, just trying new things O:-)
> >> >
> >> > On that note: not added to tasklist: do we need the LaTeX handler? Do
> we
> >> > need any others? Please confirm O:-)
> >>
> >> See above.
> >>
> >
> > I've got html and text working, text wasn't hard. I will give it a good
> > college try on the LaTeX and man formats. Might be easy. The issue here
> is
> > the custom node I introduced for the collapsible details sections which
> has
> > no default handler in the generators. I'll have to learn more about that
> > part of the API, I haven't interfaced with it much yet.
>
> Understand.
>
> Have you considered cutting the series in half before the inliner?
> First part emits "The members of ..." like the old doc generator.
> Second part replaces that with inlined material.
>
> We could totally release with just the first half! Inlining is great,
> but even without it, your work looks so much better and is so much more
> usable.
>
I may indeed just do that... though we still need to solve "where to put
the ifcond data?" question. The documentation culling also must be held
back in this case too, which I am fine with.
Let me fork my work (again) and see how complicated an inlinerless version
would be... maybe that's a great way to flush the queue. maybe.
>
> >> > On Fri, Feb 14, 2025 at 7:05 AM Markus Armbruster <armbru@redhat.com>
> wrote:
> >> >
> >> >> I started to eyeball old and new generated output side by side.
> >> >>
> >> >> New table of contents shows one level, old two. No objection; the
> >> >> navigation thingie on the left is more useful anyway.
> >> >>
> >> >
> >> > Unintentional, but if you like it, it's fine by me. Nothing added to
> my
> >> > tasklist.
> >>
> >> Mention in a commit message.
> >>
> >
> > Sure. I... just need to figure out which commit to mention it in. Added
> to
> > my list, anyway.
>
It turns out this happens in the "example" doc patch, it's just a setting
in index.rst. I didn't even intend to commit that patch anyway. So this is
a nothing-burger.
> >
> >
> >>
> >> >> The new generator elides unreferenced types. Generally good, but two
> >> >> observations:
> >> >>
> >> >> * QapiErrorClass is unreferenced, but its members are mentioned in
> >> >> Errors sections. QapiErrorClass serves as better than nothing
> error
> >> >> code documentation, but it's gone in the new doc. So this is a
> minor
> >> >> regression. We can figure out what to do about it later.
> >> >>
> >> >
> >> > Right. I debated making the members references to that class, but
> recalled
> >> > that you disliked this class and figured you'd not like such a
> change, so I
> >> > just left it alone. I do not have cross-references for individual
> members
> >> > of objects at all yet anyway, so this is definitely more work
> regardless.
> >> >
> >> > We could always create a pragma of some sort (or just hardcode a
> list) of
> >> > items that must be documented regardless of if they're referenced or
> not.
> >> > Please let me know your preference and I will add a "ticket" on my
> personal
> >> > tasklist for this project to handle that at /some point/. Nothing
> added to
> >> > my tasklist just yet.
> >>
> >> Suggest to add something like "compensate for the loss of QapiErrorClass
> >> documentation in the QEMU QMP Reference Manual".
> >>
> >
> > Got it. Possibly a "for later" task but not much later. It can always
> come
> > after this first series, but before we "turn on" the new generator, if
> that
> > makes sense. Just so we reach a quiescent point and flush the
> staggeringly
> > large queue.
>
> I think we could even do it after "turn on". Yes, it's a small
> regression, but I believe the improvements are big enough to outweigh
> small regressions like this one.
>
OK.
>
> > I guess what I mean is: "Let's make sure what I've got here so far is
> good
> > first, and then I'll start adding stuff."
>
> [...]
>
> >> >> The new doc's headings use "Struct" or "Union" where the old one uses
> >> >> just "Object". Let's keep "Object", please.
> >> >>
> >> >
> >> > I was afraid you'd ask for this. OK, I think it's an easy change. Can
> I
> >> > keep the index page segmented by object type still, though?
> >> >
> >> > I do find knowing the *type* of object to be helpful as a developer,
> >>
> >> Can you explain why and how struct vs. union matters to you as a
> >> developer?
> >>
> >
> > I suppose it's just internal details that I like to know, but tend to
> find
> > the HTML reference easier to work with than grepping through the qapi
> > files. I'm gonna change it for you anyway because I agree it's not
> > consistent with the philosophy of "end user QMP reference". Just feels
> like
> > a tiny shame somehow.
> >
> >
> >>
> >> > though
> >> > I understand that from the point of view of a QMP user, they're all
> just
> >> > objects, so your request makes sense.
> >>
> >> I'd prefer a single index.
> >>
> >
> > So ... structs, unions, alternates all condensed down to "Object", is
> that
> > right? We get to keep command/enum/event separate, I assume.
>
> No, only structs and unions are "Object", alternates are "Alternate".
>
> For me, the separation between struct and union is an unfortunate
> remnant of somewhat winding development history.
>
> A union is has common members, one of them is the tag, and for each tag
> value, it may have variant members.
>
> A struct is a degenerate union: no variants.
>
> This is as old as the hills: Pascal records are just like this.
>
> QMP introspection doesn't show structs and unions, just objects, which
> may or may not have variants.
>
> The schema language syntax, however, is still rooted (stuck?) in a past
> when unions could not have common members other than the tag.
>
OK, I can combine these two easily then. I see why you feel it isn't worth
knowing the difference for developers either under this view.
>
> [...]
>
> >> >> The new doc doesn't show non-definition conditionals, as mentioned in
> >> >> the cover letter. It shows definition conditionals twice. Once
> should
> >> >> suffice.
> >> >>
> >> >
> >> > Known/intentional issue. I couldn't decide where I wanted it, so I
> put it
> >> > in both places. If you have a strong opinion right now, please let me
> know
> >> > what it is and I'll take care of it, it's easy - but it's code in the
> >> > predecessor series and nothing to do with qapidoc, so please put it
> out of
> >> > mind for now.
> >> >
> >> > If you don't have strong feelings, or you feel that the answer may
> depend
> >> > on how we solve other glaring issues (non-definition conditionals),
> let's
> >> > wait a little bit before making a decision.
> >> >
> >> > Added to tasklist: "Remove the duplication of definition
> conditionals";
> >> > left unspecified is how or in what direction :)
> >>
> >> ACK
> >>
> >> I'll try to make up my mind :)
> >>
> >
> > I should also point out, this is an issue in the domain and not the
> > generator; the generated rst document doesn't have this duplication. So
> > it's kind of a no-op while we look and consider this specific series, but
> > it's still on my list when we go to look at the predecessor series.
>
> Understood.
>
> [...]
>
>
[-- Attachment #2: Type: text/html, Size: 13076 bytes --]
prev parent reply other threads:[~2025-02-21 18:09 UTC|newest]
Thread overview: 67+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-05 23:11 [PATCH 00/42] docs: add sphinx-domain rST generator to qapidoc John Snow
2025-02-05 23:11 ` [PATCH 01/42] docs/qapidoc: support header-less freeform sections John Snow
2025-02-11 14:51 ` Markus Armbruster
2025-02-11 17:21 ` John Snow
2025-02-05 23:11 ` [PATCH 02/42] qapi/parser: adjust info location for doc body section John Snow
2025-02-05 23:11 ` [PATCH 03/42] docs/qapidoc: remove example section support John Snow
2025-02-05 23:11 ` [PATCH 04/42] qapi: expand tags to all doc sections John Snow
2025-02-05 23:11 ` [PATCH 05/42] qapi/schema: add __repr__ to QAPIDoc.Section John Snow
2025-02-05 23:11 ` [PATCH 06/42] docs/qapidoc: add transmogrifier stub John Snow
2025-02-05 23:11 ` [PATCH 07/42] docs/qapidoc: add transmogrifier class stub John Snow
2025-02-05 23:11 ` [PATCH 08/42] docs/qapidoc: add visit_module() method John Snow
2025-02-05 23:11 ` [PATCH 09/42] qapi/source: allow multi-line QAPISourceInfo advancing John Snow
2025-02-05 23:11 ` [PATCH 10/42] docs/qapidoc: add visit_freeform() method John Snow
2025-02-05 23:11 ` [PATCH 11/42] docs/qapidoc: add preamble() method John Snow
2025-02-05 23:11 ` [PATCH 12/42] docs/qapidoc: add visit_paragraph() method John Snow
2025-02-05 23:11 ` [PATCH 13/42] docs/qapidoc: add visit_errors() method John Snow
2025-02-05 23:11 ` [PATCH 14/42] docs/qapidoc: add format_type() method John Snow
2025-02-05 23:11 ` [PATCH 15/42] docs/qapidoc: add add_field() and generate_field() helper methods John Snow
2025-02-05 23:11 ` [PATCH 16/42] docs/qapidoc: add visit_feature() method John Snow
2025-02-05 23:11 ` [PATCH 17/42] docs/qapidoc: prepare to record entity being transmogrified John Snow
2025-02-05 23:11 ` [PATCH 18/42] docs/qapidoc: add visit_returns() method John Snow
2025-02-05 23:11 ` [PATCH 19/42] docs/qapidoc: add visit_member() method John Snow
2025-02-05 23:11 ` [PATCH 20/42] docs/qapidoc: add visit_sections() method John Snow
2025-02-05 23:11 ` [PATCH 21/42] docs/qapidoc: add visit_entity() John Snow
2025-02-05 23:11 ` [PATCH 22/42] docs/qapidoc: implement transmogrify() method John Snow
2025-02-05 23:11 ` [PATCH 23/42] docs: disambiguate cross-references John Snow
2025-02-05 23:11 ` [PATCH 24/42] docs/qapidoc: add transmogrifier test document John Snow
2025-02-05 23:11 ` [PATCH 25/42] docs/qapidoc: generate entries for undocumented members John Snow
2025-02-05 23:11 ` [PATCH 26/42] qapi/parser: add undocumented stub members to all_sections John Snow
2025-02-05 23:11 ` [PATCH 27/42] qapi: differentiate "intro" and "detail" sections John Snow
2025-02-11 15:00 ` Markus Armbruster
2025-02-18 20:30 ` John Snow
2025-02-05 23:11 ` [PATCH 28/42] qapi/parser: prohibit untagged sections between tagged sections John Snow
2025-02-12 9:06 ` Markus Armbruster
2025-02-18 21:36 ` John Snow
2025-02-19 7:58 ` Markus Armbruster
2025-02-17 11:53 ` Markus Armbruster
2025-02-05 23:11 ` [PATCH 29/42] qapi: Add "Details:" disambiguation marker John Snow
2025-02-12 9:37 ` Markus Armbruster
2025-02-18 22:22 ` John Snow
2025-02-17 10:51 ` Markus Armbruster
2025-02-18 22:23 ` John Snow
2025-02-17 11:55 ` Markus Armbruster
2025-02-18 22:26 ` John Snow
2025-02-19 9:04 ` Markus Armbruster
2025-02-17 12:13 ` Markus Armbruster
2025-02-18 22:48 ` John Snow
2025-02-19 12:49 ` Markus Armbruster
2025-02-05 23:11 ` [PATCH 30/42] docs/qapidoc: add minimalistic inliner John Snow
2025-02-05 23:11 ` [PATCH 31/42] docs/qapidoc: autogenerate undocumented return docs John Snow
2025-02-05 23:11 ` [PATCH 32/42] docs/qapidoc: Add generated returns documentation to inliner John Snow
2025-02-05 23:11 ` [PATCH 33/42] docs/qmp: add target to Out-of-band execution section John Snow
2025-02-05 23:12 ` [PATCH 34/42] docs/qapidoc: document the "out-of-band" pseudofeature John Snow
2025-02-05 23:12 ` [PATCH 35/42] docs/qapidoc: generate out-of-band pseudofeature sections John Snow
2025-02-05 23:12 ` [PATCH 36/42] qapi/parser: add "meta" kind to QAPIDoc.Kind John Snow
2025-02-05 23:12 ` [PATCH 37/42] qapi/schema: add __iter__ method to QAPISchemaVariants John Snow
2025-02-05 23:12 ` [PATCH 38/42] docs/qapi: add branch support to inliner John Snow
2025-02-05 23:12 ` [PATCH 39/42] qapi/schema: add doc_visible property to QAPISchemaDefinition John Snow
2025-02-05 23:12 ` [PATCH 40/42] docs/qapidoc: cull (most) un-named entities from docs John Snow
2025-02-05 23:12 ` [PATCH 41/42] qapi: resolve filenames in info structures John Snow
2025-02-05 23:12 ` [PATCH 42/42] docs/qapidoc: add intermediate output debugger John Snow
2025-02-14 12:05 ` [PATCH 00/42] docs: add sphinx-domain rST generator to qapidoc Markus Armbruster
2025-02-18 20:01 ` John Snow
2025-02-19 13:22 ` Markus Armbruster
2025-02-20 20:32 ` John Snow
2025-02-21 6:41 ` Markus Armbruster
2025-02-21 18:08 ` John Snow [this message]
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-aG38tqxue2ZvHP_9LEyWXXxawd=SCuOJNptNKOihONUg@mail.gmail.com' \
--to=jsnow@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=eblake@redhat.com \
--cc=eduardo@habkost.net \
--cc=farosas@suse.de \
--cc=jasowang@redhat.com \
--cc=lukasstraub2@web.de \
--cc=marcel.apfelbaum@gmail.com \
--cc=michael.roth@amd.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=peterx@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@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;
as well as URLs for NNTP newsgroup(s).