From: John Snow Date: Tue, 11 Mar 2025 03:42:53 +0000 (-0400) Subject: docs/qapidoc: process @foo into ``foo`` X-Git-Tag: v10.0.0-rc0~11^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9b6f988037b3d6f042871b149c7fd307bed8475;p=thirdparty%2Fqemu.git 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 Message-ID: <20250311034303.75779-56-jsnow@redhat.com> Acked-by: Markus Armbruster Signed-off-by: Markus Armbruster --- diff --git a/docs/sphinx/qapidoc.py b/docs/sphinx/qapidoc.py index a0016f88532..ebdf709594e 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: