]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
docs/qapidoc: process @foo into ``foo``
authorJohn Snow <jsnow@redhat.com>
Tue, 11 Mar 2025 03:42:53 +0000 (23:42 -0400)
committerMarkus Armbruster <armbru@redhat.com>
Tue, 11 Mar 2025 09:26:52 +0000 (10:26 +0100)
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>
docs/sphinx/qapidoc.py

index a0016f88532e2e1d7a4d5619e67653f97e333e2e..ebdf709594e30808f627b37e0f0daee9e0711e49 100644 (file)
@@ -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: