sphinx: qapidoc: Wrap "If" section body in a paragraph node
cover sphinx: qapidoc: Wrap "If" section body in a paragraph node
(See commit message.)
John Snow (1):
sphinx: qapidoc: Wrap "If" section body in a paragraph node
docs/sphinx/qapidoc.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Signature · 1 line
2.30.2
PATCH 1/1 sphinx: qapidoc: Wrap "If" section body in a paragraph node
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)
...
--- docs/sphinx/qapidoc.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
docs/sphinx/qapidoc.py +3 -1
@@ -278,7 +278,9 @@ def _nodes_for_if_section(self, ifcond): 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
Signature · 1 line
2.30.2
Quoted 36 lines · John Snow
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)
...
Quoted 3 lines
Reported-by Markus Armbruster <[email protected]>Tested-by Markus Armbruster <[email protected]>Signed-off-by John Snow <[email protected]>
It's a shame Sphinx doesn't diagnose this kind of mis-constructed document tree.
thanks
-- PMM
Quoted 2 lines · John Snow
These sections need to be wrapped in a block-level element, such as Paragraph in order for them to be rendered into Texinfo correctly.
Into man, not into Texinfo.
[...]
Peter, do you intend to merge this yourself? I have nothing else queued right now. If you want me to do a pull request for this patch, let me know.
Quoted 4 lines · Markus Armbruster
Peter, do you intend to merge this yourself? I have nothing else queued right now. If you want me to do a pull request for this patch, let me know.
I missed this email earlier. I had assumed somebody else would pick it up, but as it happens I have a couple of last minute patches I want to send out anyway, so I'll pick this up now.
thanks
-- PMM