qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/8] docs/qapidoc: add QMP highlighting to annotated qmp-exam


From: John Snow
Subject: Re: [PATCH 3/8] docs/qapidoc: add QMP highlighting to annotated qmp-example blocks
Date: Tue, 9 Jul 2024 18:47:50 -0400



On Tue, Jul 9, 2024 at 6:33 AM Markus Armbruster <armbru@redhat.com> wrote:
John Snow <jsnow@redhat.com> writes:

> For any code literal blocks inside of a qmp-example directive, apply and
> enforce the QMP lexer/highlighter to those blocks.
>
> This way, you won't need to write:
>
> ```
> .. qmp-example::
>    :annotated:
>
>    Blah blah
>
>    .. code-block:: QMP
>
>       -> { "lorem": "ipsum" }
> ```
>
> But instead, simply:
>
> ```
> .. qmp-example::
>    :annotated:
>
>    Blah blah::
>
>      -> { "lorem": "ipsum" }
> ```
>
> Once the directive block is exited, whatever the previous default
> highlight language was will be restored; localizing the forced QMP
> lexing to exclusively this directive.
>
> Note, if the default language is *already* QMP, this directive will not
> generate and restore redundant highlight configuration nodes. We may
> well decide that the default language ought to be QMP for any QAPI
> reference pages, but this way the directive behaves consistently no
> matter where it is used.
>
> Signed-off-by: John Snow <jsnow@redhat.com>

Sadly, the previous patch didn't add tests, so this patch's effect
isn't as easy to observe as it could be.

Sorry O:-)

In truth, I never intended it to *not* have this feature, but thought it was helpful to split out just the code responsible for this feature into its own patch so its soul could be independently judged to see if it was lighter than a feather.

(i.e., does the convenience justify the SLOC?)
 

Acked-by: Markus Armbruster <armbru@redhat.com>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]