| bac3f131 | 10-Mar-2025 |
John Snow <jsnow@redhat.com> |
docs/qapi-domain: add qapi:alternate directive
Add the .. qapi:alternate:: directive, object, and qapi:alt:`name` cross-reference role.
Add the "Alternatives:" field list for describing alternate c
docs/qapi-domain: add qapi:alternate directive
Add the .. qapi:alternate:: directive, object, and qapi:alt:`name` cross-reference role.
Add the "Alternatives:" field list for describing alternate choices. Like other field lists that reference QAPI types, a forthcoming commit will add cross-referencing support to this field.
Signed-off-by: John Snow <jsnow@redhat.com> Message-ID: <20250311034303.75779-21-jsnow@redhat.com> Acked-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
| 902c9b0e | 10-Mar-2025 |
John Snow <jsnow@redhat.com> |
docs/qapi-domain: add qapi:enum directive
Add the .. qapi:enum:: directive, object, and :qapi:enum:`name` cross-reference role.
Add the :value name: field list for documenting Enum values.
Of note
docs/qapi-domain: add qapi:enum directive
Add the .. qapi:enum:: directive, object, and :qapi:enum:`name` cross-reference role.
Add the :value name: field list for documenting Enum values.
Of note, also introduce a new "type" role that is intended to be used by other QAPI object directives to cross-reference arbitrary QAPI type names, but will exclude commands, events, and modules from consideration.
Signed-off-by: John Snow <jsnow@redhat.com> Message-ID: <20250311034303.75779-20-jsnow@redhat.com> Acked-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
| 8b77f8d5 | 10-Mar-2025 |
John Snow <jsnow@redhat.com> |
docs/qapi-domain: add "Return:" field lists
Add "Return:" field list syntax to QAPI Commands.
Like "Arguments:" and "Errors:", the type name isn't currently processed for cross-referencing, but thi
docs/qapi-domain: add "Return:" field lists
Add "Return:" field list syntax to QAPI Commands.
Like "Arguments:" and "Errors:", the type name isn't currently processed for cross-referencing, but this will be addressed in a forthcoming commit.
The syntax of the new field is:
:return TypeName: description description cont'd
This patch adds "Return" as a GroupedField, which means that multiple return values can be annotated - this is only done because Sphinx does not support mandatory type arguments to Ungrouped fields. Because we want to cross-reference this type information later, we want to make the type argument mandatory. As a result, you can technically add multiple :return: fields, though I'm not aware of any circumstance in which you'd need or want to. Recommendation: "Don't do that, then." The forthcoming QAPIDoc transmogrifier does not, in fact, ever "do that".
Signed-off-by: John Snow <jsnow@redhat.com> Message-ID: <20250311034303.75779-19-jsnow@redhat.com> Acked-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
| 9605c204 | 10-Mar-2025 |
John Snow <jsnow@redhat.com> |
docs/qapi-domain: add "Errors:" field lists
``:error: descr`` can now be used to document error conditions. The format of the description is not defined here; so the ability to name specific types i
docs/qapi-domain: add "Errors:" field lists
``:error: descr`` can now be used to document error conditions. The format of the description is not defined here; so the ability to name specific types is left to the document writer.
Signed-off-by: John Snow <jsnow@redhat.com> Message-ID: <20250311034303.75779-18-jsnow@redhat.com> Acked-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
| 3d9a23f9 | 10-Mar-2025 |
John Snow <jsnow@redhat.com> |
docs/qapi-domain: add "Features:" field lists
Add support for Features field lists. There is no QAPI-specific functionality here, but this could be changed if desired (if we wanted the feature names
docs/qapi-domain: add "Features:" field lists
Add support for Features field lists. There is no QAPI-specific functionality here, but this could be changed if desired (if we wanted the feature names to link somewhere, for instance.)
This feature list doesn't have any restrictions, so it can be used to document object-wide features or per-member features as deemed appropriate. It's essentially free-form text.
The syntax for this field is:
:feat name: description description cont'd
Signed-off-by: John Snow <jsnow@redhat.com> Message-ID: <20250311034303.75779-17-jsnow@redhat.com> Acked-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
| 61837970 | 10-Mar-2025 |
John Snow <jsnow@redhat.com> |
docs/qapi-domain: add "Arguments:" field lists
This adds special rendering for Sphinx's typed info field lists.
This patch does not add any QAPI-aware markup, rendering, or cross-referencing for th
docs/qapi-domain: add "Arguments:" field lists
This adds special rendering for Sphinx's typed info field lists.
This patch does not add any QAPI-aware markup, rendering, or cross-referencing for the type names, yet. That feature requires a subclass to TypedField which will happen in its own commit quite a bit later in this series; after all the basic fields and objects have been established first.
The syntax for this field is:
:arg type name: description description cont'd
You can omit the type or the description. You should not omit the name; if you do so, it degenerates into a "normal field list" entry, and probably isn't what you want.
Signed-off-by: John Snow <jsnow@redhat.com> Message-ID: <20250311034303.75779-16-jsnow@redhat.com> Acked-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
| 700d51a4 | 10-Mar-2025 |
John Snow <jsnow@redhat.com> |
docs/qapi-domain: add :since: directive option
Add a little special markup for registering "Since:" information. Adding it as an option instead of generic content lets us hoist the information into
docs/qapi-domain: add :since: directive option
Add a little special markup for registering "Since:" information. Adding it as an option instead of generic content lets us hoist the information into the Signature bar, optionally put it in the index, etc.
Signed-off-by: John Snow <jsnow@redhat.com> Message-ID: <20250311034303.75779-15-jsnow@redhat.com> Acked-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
| 758bbdcd | 10-Mar-2025 |
John Snow <jsnow@redhat.com> |
docs/qapi-domain: add qapi:command directive
This commit adds a stubbed version of QAPICommand that utilizes the QAPIObject class, the qapi:command directive, the :qapi:cmd: cross-reference role, an
docs/qapi-domain: add qapi:command directive
This commit adds a stubbed version of QAPICommand that utilizes the QAPIObject class, the qapi:command directive, the :qapi:cmd: cross-reference role, and the "command" object type in the QAPI object registry.
They don't do anything *particularly* interesting yet, but that will come in forthcoming commits.
Signed-off-by: John Snow <jsnow@redhat.com> Message-ID: <20250311034303.75779-14-jsnow@redhat.com> Acked-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
| 8799c364 | 10-Mar-2025 |
John Snow <jsnow@redhat.com> |
docs/qapi-domain: add QAPIObject class
This patch adds another abstract class that describes "a QAPI thingie". The main difference here is that this class will be generating visible documentation, u
docs/qapi-domain: add QAPIObject class
This patch adds another abstract class that describes "a QAPI thingie". The main difference here is that this class will be generating visible documentation, unlike the QAPIDescription class.
Signed-off-by: John Snow <jsnow@redhat.com> Message-ID: <20250311034303.75779-13-jsnow@redhat.com> Acked-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
| 7320feeb | 10-Mar-2025 |
John Snow <jsnow@redhat.com> |
docs/qapi-domain: add qapi:module directive
This adds the qapi:module directive, which just notes the current module being documented and performs a nested parse of the content block, if present.
T
docs/qapi-domain: add qapi:module directive
This adds the qapi:module directive, which just notes the current module being documented and performs a nested parse of the content block, if present.
This code is based pretty heavily on Sphinx's PyModule directive, but with unnecessary features excised.
For example:
.. qapi:module:: block-core
Hello, and welcome to block-core! =================================
lorem ipsum, dolor sit amet ...
Signed-off-by: John Snow <jsnow@redhat.com> Message-ID: <20250311034303.75779-12-jsnow@redhat.com> Acked-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
| 1ea66486 | 10-Mar-2025 |
John Snow <jsnow@redhat.com> |
docs/qapi-domain: Add QAPIDescription abstract class
This class is a generic, top-level directive for documenting some kind of QAPI thingamajig that we expect to go into the Index. This class doesn'
docs/qapi-domain: Add QAPIDescription abstract class
This class is a generic, top-level directive for documenting some kind of QAPI thingamajig that we expect to go into the Index. This class doesn't do much by itself, and it isn't yet associated with any particular directive.
handle_signature(), _object_hierarchy_parts() and _toc_entry_name() are defined in the base class. get_index_text() and add_target_and_index() are new methods defined here; they are based heavily on the layout and format of the Python domain's general object class.
Signed-off-by: John Snow <jsnow@redhat.com> Message-ID: <20250311034303.75779-11-jsnow@redhat.com> Acked-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
| 6d64a27c | 10-Mar-2025 |
John Snow <jsnow@redhat.com> |
docs/qapi-domain: add compatibility node classes
Sphinx prior to v4.0 uses different classes for rendering elements of documentation objects; add some compatibility classes to use the right node cla
docs/qapi-domain: add compatibility node classes
Sphinx prior to v4.0 uses different classes for rendering elements of documentation objects; add some compatibility classes to use the right node classes conditionally.
Signed-off-by: John Snow <jsnow@redhat.com> Message-ID: <20250311034303.75779-10-jsnow@redhat.com> Acked-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
| 760b37e1 | 10-Mar-2025 |
John Snow <jsnow@redhat.com> |
docs/qapi-domain: add QAPI xref roles
Add domain-specific cross-reference syntax. As of this commit, that means new :qapi:any:`block-core` referencing syntax.
The :any: role will find anything regi
docs/qapi-domain: add QAPI xref roles
Add domain-specific cross-reference syntax. As of this commit, that means new :qapi:any:`block-core` referencing syntax.
The :any: role will find anything registered to the QAPI domain, including modules, commands, events, etc.
Creating the cross-references is powered by the QAPIXRefRole class; resolving them is handled by QAPIDomain.resolve_xref().
QAPIXrefRole is based heavily on Sphinx's own PyXrefRole, with modifications necessary for QAPI features.
Signed-off-by: John Snow <jsnow@redhat.com> Message-ID: <20250311034303.75779-9-jsnow@redhat.com> Acked-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
| dca2f3c4 | 10-Mar-2025 |
John Snow <jsnow@redhat.com> |
docs/qapi-domain: add resolve_any_xref()
Add the ability to resolve cross-references using the `any` cross-reference syntax. Adding QAPI-specific cross-reference roles will be added in a forthcoming
docs/qapi-domain: add resolve_any_xref()
Add the ability to resolve cross-references using the `any` cross-reference syntax. Adding QAPI-specific cross-reference roles will be added in a forthcoming commit, and will share the same find_obj() helper.
(There's less code needed for the generic cross-reference resolver, so it comes first in this series.)
Once again, this code is based very heavily on sphinx.domains.python.
Signed-off-by: John Snow <jsnow@redhat.com> Message-ID: <20250311034303.75779-8-jsnow@redhat.com> Acked-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
| e93d29d2 | 10-Mar-2025 |
John Snow <jsnow@redhat.com> |
docs/qapi-domain: add QAPI index
Use the QAPI object registry to generate a special index just for QAPI definitions. The index can show entries both by definition type and all together, alphabetical
docs/qapi-domain: add QAPI index
Use the QAPI object registry to generate a special index just for QAPI definitions. The index can show entries both by definition type and all together, alphabetically.
The index can be linked from anywhere in the QEMU manual by using the reference `qapi-index`.
Signed-off-by: John Snow <jsnow@redhat.com> Message-ID: <20250311034303.75779-7-jsnow@redhat.com> Acked-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
| 36ceafad | 10-Mar-2025 |
John Snow <jsnow@redhat.com> |
docs/qapi-domain: add QAPI domain object registry
This is the first step towards QAPI domain cross-references and a QAPI reference index.
This patch just creates the object registry, and updates th
docs/qapi-domain: add QAPI domain object registry
This is the first step towards QAPI domain cross-references and a QAPI reference index.
This patch just creates the object registry, and updates the merge_domaindata stub method now that we have actual data we may need to merge.
Note that how to handle merge conflict resolution is unhandled, as the Sphinx python domain itself does not handle it either. I do not know how to intentionally trigger it, so I've left an assertion instead if it should ever come up ...
Signed-off-by: John Snow <jsnow@redhat.com> Message-ID: <20250311034303.75779-6-jsnow@redhat.com> Acked-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
| abf6bedc | 10-Mar-2025 |
John Snow <jsnow@redhat.com> |
docs/sphinx: add compat.py module and nested_parse helper
Create a compat module that handles sphinx cross-version compatibility issues. For the inaugural function, add a nested_parse_with_titles()
docs/sphinx: add compat.py module and nested_parse helper
Create a compat module that handles sphinx cross-version compatibility issues. For the inaugural function, add a nested_parse_with_titles() helper that handles differences in line number tracking for nested directive body parsing.
Spoilers: there are more cross-version hacks to come throughout the series.
Signed-off-by: John Snow <jsnow@redhat.com> Message-ID: <20250311034303.75779-5-jsnow@redhat.com> Acked-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
| 5e4c466e | 23-Feb-2025 |
John Snow <jsnow@redhat.com> |
docs/qapidoc: remove example section support
Since commit 3c5f6114 (qapi: remove "Example" doc section), Example sections no longer exist, so this support in qapidoc is now dead code.
Signed-off-by
docs/qapidoc: remove example section support
Since commit 3c5f6114 (qapi: remove "Example" doc section), Example sections no longer exist, so this support in qapidoc is now dead code.
Signed-off-by: John Snow <jsnow@redhat.com> Message-ID: <20250224033741.222749-7-jsnow@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
| 76e375fc | 16-Jul-2024 |
John Snow <jsnow@redhat.com> |
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 w
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>
show more ...
|
| 547864f9 | 16-Jul-2024 |
John Snow <jsnow@redhat.com> |
docs/qapidoc: create qmp-example directive
This is a directive that creates a syntactic sugar for creating "Example" boxes very similar to the ones already used in the bitmaps.rst document, please s
docs/qapidoc: create qmp-example directive
This is a directive that creates a syntactic sugar for creating "Example" boxes very similar to the ones already used in the bitmaps.rst document, please see e.g. https://www.qemu.org/docs/master/interop/bitmaps.html#creation-block-dirty-bitmap-add
In its simplest form, when a custom title is not needed or wanted, and the example body is *solely* a QMP example:
``` .. qmp-example::
{body} ```
is syntactic sugar for:
``` .. admonition:: Example:
.. code-block:: QMP
{body} ```
When a custom, plaintext title that describes the example is desired, this form:
``` .. qmp-example:: :title: Defrobnification
{body} ```
Is syntactic sugar for:
``` .. admonition:: Example: Defrobnification
.. code-block:: QMP
{body} ```
Lastly, when Examples are multi-step processes that require non-QMP exposition, have lengthy titles, or otherwise involve prose with rST markup (lists, cross-references, etc), the most complex form:
``` .. qmp-example:: :annotated:
This example shows how to use `foo-command`::
{body}
For more information, please see `frobnozz`. ```
Is desugared to:
``` .. admonition:: Example:
This example shows how to use `foo-command`::
{body}
For more information, please see `frobnozz`. ```
Note that :annotated: and :title: options can be combined together, if desired.
The primary benefit here being documentation source consistently using the same directive for all forms of examples to ensure consistent visual styling, and ensuring all relevant prose is visually grouped alongside the code literal block.
Note that as of this commit, the code-block rST syntax "::" does not apply QMP highlighting; you would need to use ".. code-block:: QMP". The very next commit changes this behavior to assume all "::" code blocks within this directive are QMP blocks.
Signed-off-by: John Snow <jsnow@redhat.com> Acked-by: Markus Armbruster <armbru@redhat.com> Message-ID: <20240717021312.606116-4-jsnow@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
show more ...
|