qemu/docs/sphinx
John Snow 76e375fc3c docs/qapidoc: add QMP highlighting to annotated qmp-example blocks
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>
Acked-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20240717021312.606116-5-jsnow@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2024-07-17 10:20:53 +02:00
..
dbusdoc.py docs/sphinx: add sphinx modules to include D-Bus documentation 2021-12-21 10:50:21 +04:00
dbusdomain.py meson: Pass -j option to sphinx 2023-05-18 08:53:50 +02:00
dbusparser.py docs/sphinx: add sphinx modules to include D-Bus documentation 2021-12-21 10:50:21 +04:00
depfile.py docs/sphinx: add templates files to generated depfile 2021-11-08 12:27:23 +04:00
fakedbusdoc.py meson: Pass -j option to sphinx 2023-05-18 08:53:50 +02:00
hxtool.py docs: remove Sphinx 1.x compatibility code 2024-07-12 16:46:21 -04:00
kerneldoc.py docs: remove Sphinx 1.x compatibility code 2024-07-12 16:46:21 -04:00
qapidoc.py docs/qapidoc: add QMP highlighting to annotated qmp-example blocks 2024-07-17 10:20:53 +02:00
qmp_lexer.py meson: Pass -j option to sphinx 2023-05-18 08:53:50 +02:00