aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2025-03-10 23:42:53 -0400
committerMarkus Armbruster <armbru@redhat.com>2025-03-11 10:26:52 +0100
commitc9b6f988037b3d6f042871b149c7fd307bed8475 (patch)
tree1ba625baa1a0a9365c1a9e64f744ef2e6d4c5fc1
parent5c1636f7cc4bfbe5737e3acca009a97dfa188879 (diff)
downloadqemu-c9b6f988037b3d6f042871b149c7fd307bed8475.zip
qemu-c9b6f988037b3d6f042871b149c7fd307bed8475.tar.gz
qemu-c9b6f988037b3d6f042871b149c7fd307bed8475.tar.bz2
docs/qapidoc: process @foo into ``foo``
Add support for the special QAPI doc syntax to process @references as ``preformatted text``. At the moment, there are no actual cross-references for individual members, so there is nothing to link against. For now, process it identically to how we did in the old qapidoc system. Signed-off-by: John Snow <jsnow@redhat.com> Message-ID: <20250311034303.75779-56-jsnow@redhat.com> Acked-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
-rw-r--r--docs/sphinx/qapidoc.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/docs/sphinx/qapidoc.py b/docs/sphinx/qapidoc.py
index a0016f8..ebdf709 100644
--- a/docs/sphinx/qapidoc.py
+++ b/docs/sphinx/qapidoc.py
@@ -303,6 +303,9 @@ class Transmogrifier:
# Add sections in source order:
for section in sections:
+ # @var is translated to ``var``:
+ section.text = re.sub(r"@([\w-]+)", r"``\1``", section.text)
+
if section.kind == QAPIDoc.Kind.PLAIN:
self.visit_paragraph(section)
elif section.kind == QAPIDoc.Kind.MEMBER: