summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2025-03-10 23:42:43 -0400
committerMarkus Armbruster <armbru@redhat.com>2025-03-11 10:10:57 +0100
commite9fbf1a0c6c2df9c53bb577b4245cf48914687fe (patch)
tree4b31485dcd7cc7c4be812dc3bfa6eca597abaf7a
parent56e1adf293037ec3324a7f20d54d50cd671dc281 (diff)
downloadfocaccia-qemu-e9fbf1a0c6c2df9c53bb577b4245cf48914687fe.tar.gz
focaccia-qemu-e9fbf1a0c6c2df9c53bb577b4245cf48914687fe.zip
docs/qapidoc: add visit_errors() method
Notably, this method does not currently address the formatting issues
present with the "errors" section in QAPIDoc and just vomits the text
verbatim into the rST doc, with somewhat inconsistent results.

To be addressed in a future patch.

Signed-off-by: John Snow <jsnow@redhat.com>
Message-ID: <20250311034303.75779-46-jsnow@redhat.com>
Acked-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
-rw-r--r--docs/sphinx/qapidoc.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/sphinx/qapidoc.py b/docs/sphinx/qapidoc.py
index a9f98d4657..c17cb9f9b1 100644
--- a/docs/sphinx/qapidoc.py
+++ b/docs/sphinx/qapidoc.py
@@ -139,6 +139,12 @@ class Transmogrifier:
         self.add_lines(section.text, section.info)
         self.ensure_blank_line()
 
+    def visit_errors(self, section: QAPIDoc.Section) -> None:
+        # FIXME: the formatting for errors may be inconsistent and may
+        # or may not require different newline placement to ensure
+        # proper rendering as a nested list.
+        self.add_lines(f":error:\n{section.text}", section.info)
+
     def preamble(self, ent: QAPISchemaDefinition) -> None:
         """
         Generate option lines for QAPI entity directives.