From: Vladimír Vondruš Date: Thu, 18 Jan 2018 14:00:12 +0000 (+0100) Subject: doxygen: remove pointless restrictions for valid use cases. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=864751796c2a99ba80ea3924726e1390cf93c327;p=blog.git doxygen: remove pointless restrictions for valid use cases. And add a test there. --- diff --git a/doxygen/dox2html5.py b/doxygen/dox2html5.py index c65ba3cd..e8f5c29e 100755 --- a/doxygen/dox2html5.py +++ b/doxygen/dox2html5.py @@ -590,7 +590,6 @@ def parse_desc_internal(state: State, element: ET.Element, immediate_parent: ET. # Custom
with CSS classes (for making dim notes etc) elif i.tag == '{http://mcss.mosra.cz/doxygen/}div': - assert element.tag == 'para' # is inside a paragraph :/ has_block_elements = True out.parsed += '
{}
'.format(i.attrib['{http://mcss.mosra.cz/doxygen/}class'], parse_inline_desc(state, i).strip()) @@ -598,8 +597,6 @@ def parse_desc_internal(state: State, element: ET.Element, immediate_parent: ET. # Adding a custom CSS class to the immediately following block/inline # element elif i.tag == '{http://mcss.mosra.cz/doxygen/}class': - assert element.tag == 'para' # is inside a paragraph :/ - # Bubble up in case we are alone in a paragraph, as that's meant to # affect the next paragraph content. if len([listing for listing in element]) == 1: diff --git a/doxygen/test/contents_custom/index.html b/doxygen/test/contents_custom/index.html index 52287102..f70f3b7e 100644 --- a/doxygen/test/contents_custom/index.html +++ b/doxygen/test/contents_custom/index.html @@ -22,7 +22,7 @@

My Project

-
This paragraph is rendered in a dim note, centered.

This paragraph contains a red text in a normal text flow and then small strong italics, blue italics and https://mcss.mosra.cz (big-ass link).

A paragraph that is not affected by the inline classes from above.

Bold, non-indented paragraph.

Bold text that should not have the same class as the paragraph.

A paragraph that doesn't have any class applied. Next, a full-width image:

Image
Image
A flat figure

A fullwidth table:

Table headerAnother
CellAnother cell
Next rowLast.

An unstyled list:

+
This paragraph is rendered in a dim note, centered.

This paragraph contains a red text in a normal text flow and then small strong italics, blue italics and https://mcss.mosra.cz (big-ass link).

A paragraph that is not affected by the inline classes from above.

Bold, non-indented paragraph.

Bold text that should not have the same class as the paragraph.

A paragraph that doesn't have any class applied. Next, a full-width image:

Image
Image
A flat figure

A fullwidth table:

Table headerAnother
CellAnother cell
Next rowLast.

An unstyled list:

diff --git a/doxygen/test/contents_custom/input.dox b/doxygen/test/contents_custom/input.dox index 538a2958..a3e22a58 100644 --- a/doxygen/test/contents_custom/input.dox +++ b/doxygen/test/contents_custom/input.dox @@ -8,6 +8,8 @@ a normal text flow and then @m_class{m-text m-em m-small} **small strong italics @m_class{m-text m-info} *blue italics* and @m_class{m-text m-big} https://mcss.mosra.cz (big-ass link). +@m_div{m-button m-primary} @m_div{m-big} A button @m_enddiv @m_div{m-small} @m_span{m-text m-em} with @m_endspan @m_class{m-text m-em} **subtitle** @m_enddiv @m_enddiv + A paragraph that is not affected by the inline classes from above. @m_class{m-text m-strong m-noindent}