aboutsummaryrefslogtreecommitdiff
path: root/docs/sphinx/dbusdoc.py
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2025-03-10 23:42:25 -0400
committerMarkus Armbruster <armbru@redhat.com>2025-03-11 10:10:57 +0100
commit03947c80ce81702ea0ba85933bd380ec978c7635 (patch)
tree16a2fd87611ebb6f9e3ccb398797bdec3c428bc7 /docs/sphinx/dbusdoc.py
parentef137a224192cf145c8ae207fe96fd77b63596a9 (diff)
downloadqemu-03947c80ce81702ea0ba85933bd380ec978c7635.zip
qemu-03947c80ce81702ea0ba85933bd380ec978c7635.tar.gz
qemu-03947c80ce81702ea0ba85933bd380ec978c7635.tar.bz2
docs/qapi-domain: add type cross-refs to field lists
This commit, finally, adds cross-referencing support to various field lists; modeled tightly after Sphinx's own Python domain code. Cross-referencing support is added to type names provided to :arg:, :memb:, :returns: and :choice:. :feat:, :error: and :value:, which do not take type names, do not support this syntax. The general syntax is simple: :arg TypeName ArgName: Lorem Ipsum ... The domain will transform TypeName into :qapi:type:`TypeName` in this basic case, and also apply the ``literal`` decoration to indicate that this is a type cross-reference. For optional arguments, the special "?" suffix is used. Because "*" has special meaning in rST that would cause parsing errors, we elect to use "?" instead. The special syntax processing strips this character from the end of any type name argument and will append ", optional" to the rendered output, applying the cross-reference only to the actual type name. The intent here is that the actual syntax in doc-blocks need not change; but e.g. qapidoc.py will need to process and transform "@arg foo lorem ipsum" into ":arg type? foo: lorem ipsum" based on the schema information. Therefore, nobody should ever actually witness this intermediate syntax unless they are writing manual documentation or the doc transmogrifier breaks. For array arguments, type names can similarly be surrounded by "[]", which are stripped off and then re-appended outside of the cross-reference. Signed-off-by: John Snow <jsnow@redhat.com> Message-ID: <20250311034303.75779-28-jsnow@redhat.com> Acked-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'docs/sphinx/dbusdoc.py')
0 files changed, 0 insertions, 0 deletions