]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
sphinx: qapidoc: Wrap "If" section body in a paragraph node
authorJohn Snow <jsnow@redhat.com>
Tue, 6 Apr 2021 14:19:09 +0000 (10:19 -0400)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 13 Apr 2021 09:14:58 +0000 (10:14 +0100)
These sections need to be wrapped in a block-level element, such as
Paragraph in order for them to be rendered into Texinfo correctly.

Before (e.g.):

<section ids="qapidoc-713">
  <title>If</title>
  <literal>defined(CONFIG_REPLICATION)</literal>
</section>

became:

  .SS If
  \fBdefined(CONFIG_REPLICATION)\fP.SS \fBBlockdevOptionsReplication\fP (Object)
  ...

After:

<section ids="qapidoc-713">
  <title>If</title>
  <paragraph>
    <literal>defined(CONFIG_REPLICATION)</literal>
  </paragraph>
</section>

becomes:

  .SS If
  .sp
  \fBdefined(CONFIG_REPLICATION)\fP
  .SS \fBBlockdevOptionsReplication\fP (Object)
  ...

Reported-by: Markus Armbruster <armbru@redhat.com>
Tested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20210406141909.1992225-2-jsnow@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
docs/sphinx/qapidoc.py

index b7b86b5dffbbba6397e667d454e987b0dd1a53ab..b7a2d39c105c6d594bcbebb65705e71da8f72c0f 100644 (file)
@@ -278,7 +278,9 @@ class QAPISchemaGenRSTVisitor(QAPISchemaVisitor):
         nodelist = []
         if ifcond:
             snode = self._make_section('If')
-            snode += self._nodes_for_ifcond(ifcond, with_if=False)
+            snode += nodes.paragraph(
+                '', '', *self._nodes_for_ifcond(ifcond, with_if=False)
+            )
             nodelist.append(snode)
         return nodelist