out.write_paragraph_close_tag = True
# Block elements
- if i.tag in ['sect1', 'sect2', 'sect3']:
+ if i.tag in ['sect1', 'sect2', 'sect3', 'sect4']:
assert element.tag != 'para' # should be top-level block element
has_block_elements = True
tag = 'h3'
elif element.tag == 'sect3':
tag = 'h4'
+ elif element.tag == 'sect4':
+ tag = 'h5'
elif not element.tag == 'simplesect': # pragma: no cover
assert False
tag = 'h5'
elif element.tag == 'sect3':
tag = 'h6'
+ elif element.tag == 'sect4':
+ tag = 'h6'
+ logging.warning("{}: more than three levels of sections in member descriptions are not supported, stopping at <h6>".format(state.current))
elif not element.tag == 'simplesect': # pragma: no cover
assert False
else:
out.parsed += '<{0} id="{1}">{2}</{0}>'.format(tag, id, title)
+ # Apparently, in 1.8.18, <heading> is used for Markdown headers only if
+ # we run out of sect1-4 tags. Eh, what the hell.
elif i.tag == 'heading':
assert element.tag == 'para' # is inside a paragraph :/
has_block_elements = True
# Do not print anything if there are no contents
if not i.text:
- logging.warning("{}: a Markdown heading underline was apparently misparsed by Doxygen, prefix the headings with # instead (or better, use @section for properly generated TOC)".format(state.current))
+ logging.warning("{}: a Markdown heading underline was apparently misparsed by Doxygen, prefix the headings with # instead".format(state.current))
else:
h_tag_level = int(i.attrib['level'])
h_tag_level = 6
logging.warning("{}: more than five levels of Markdown headings for top-level docs are not supported, stopping at <h6>".format(state.current))
- # Emit this warning only in top-level desc, TOC is not
- # generated for function/enum/... descriptions
- logging.warning("{}: prefer @section over Markdown heading for properly generated TOC".format(state.current))
-
# Function/enum/... descriptions are inside <h3> for function
# header, which is inside <h2> for detailed definition section,
# so it needs to be <h4> and below
</tr>
</tfoot>
</table>
-<h4>A top-level header</h4><h5>A second-level header</h5><h6>A third-level header</h6><h4 id="foo-usage">Usage</h4><p>This is usage.</p><h5 id="foo-usage-more">More</h5><p>A subsection.</p><h6 id="foo-usage-more-more">More.</h6><p>Mooore.</p>
+<h4 id="autotoc_md0">A top-level header</h4><h5 id="autotoc_md1">A second-level header</h5><h6 id="autotoc_md2">A third-level header</h6><h4 id="foo-usage">Usage</h4><p>This is usage.</p><h5 id="foo-usage-more">More</h5><p>A subsection.</p><h6 id="foo-usage-more-more">More.</h6><p>Mooore.</p>
</div></section>
<section class="m-doc-details" id="ac03b94e5ed1aeeba4c9d31498e9a767a"><div>
<h3>
<span class="m-doc-wrap-bumper">void </span><span class="m-doc-wrap"><span class="m-doc-wrap-bumper"><a href="#ac03b94e5ed1aeeba4c9d31498e9a767a" class="m-doc-self">bar</a>(</span><span class="m-doc-wrap">int foo)</span></span>
</h3>
<p>This produces warnings.</p>
-<h6>Markdown heading 4 that's rendered the same as 3</h6><p>Markdown heading, underlined, is misparsed</p>
+<h6 id="autotoc_md3">Markdown heading 4 that's rendered the same as 3</h6><p>Markdown heading, underlined, is misparsed</p>
</div></section>
</section>
</div>