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>
This commit is contained in:
John Snow 2025-03-10 23:42:43 -04:00 committed by Markus Armbruster
parent 56e1adf293
commit e9fbf1a0c6

View file

@ -139,6 +139,12 @@ class Transmogrifier:
self.add_lines(section.text, section.info) self.add_lines(section.text, section.info)
self.ensure_blank_line() 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: def preamble(self, ent: QAPISchemaDefinition) -> None:
""" """
Generate option lines for QAPI entity directives. Generate option lines for QAPI entity directives.