chiark / gitweb /
doxygen: remove pointless restrictions for valid use cases.
authorVladimír Vondruš <mosra@centrum.cz>
Thu, 18 Jan 2018 14:00:12 +0000 (15:00 +0100)
committerVladimír Vondruš <mosra@centrum.cz>
Thu, 18 Jan 2018 14:02:25 +0000 (15:02 +0100)
And add a test there.

doxygen/dox2html5.py
doxygen/test/contents_custom/index.html
doxygen/test/contents_custom/input.dox

index c65ba3cdc6b22ece4076811b25f2253a199ac376..e8f5c29e8f0007efaff6fd5877d7be78c0c65dd3 100755 (executable)
@@ -590,7 +590,6 @@ def parse_desc_internal(state: State, element: ET.Element, immediate_parent: ET.
 
         # Custom <div> 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 += '<div class="{}">{}</div>'.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:
index 522871023593ee83fd1e8851eccce2ef0a8a0e0f..f70f3b7e643473a37f7907f7cff0fcd0835da2de 100644 (file)
@@ -22,7 +22,7 @@
         <h1>
           My Project
         </h1>
-<div class="m-note m-dim m-text-center">This paragraph <em>is</em> rendered in a dim note, centered.</div><p>This paragraph contains a <span class="m-text m-danger"><em>red</em> text</span> in a normal text flow and then  <strong class="m-text m-em m-small">small strong italics</strong>,   <em class="m-text m-info">blue italics</em> and  <a href="https://mcss.mosra.cz" class="m-text m-big">https:/<wbr />/<wbr />mcss.mosra.cz</a> (big-ass link).</p><p>A paragraph that is not affected by the inline classes from above.</p><p class="m-text m-strong m-noindent">Bold, non-indented paragraph.</p><p class="m-text m-primary"><strong>Bold text that should not have</strong> the same class as the paragraph.</p><p>A paragraph that doesn&#x27;t have any class applied. Next, a full-width image:</p><img class="m-image m-fullwidth" src="ship-small.jpg" alt="Image" /><figure class="m-figure m-flat"><img src="ship-small.jpg" alt="Image" /><figcaption>A flat figure</figcaption></figure><p>A fullwidth table:</p><table class="m-table m-fullwidth"><thead><tr><th>Table header</th><th>Another</th></tr></thead><tbody><tr><td>Cell</td><td>Another cell</td></tr><tr><td>Next row</td><td>Last.</td></tr></tbody></table><p>An unstyled list:</p><ul class="m-unstyled"><li>First item without a dot</li><li>Second item without a dot</li></ul>
+<div class="m-note m-dim m-text-center">This paragraph <em>is</em> rendered in a dim note, centered.</div><p>This paragraph contains a <span class="m-text m-danger"><em>red</em> text</span> in a normal text flow and then  <strong class="m-text m-em m-small">small strong italics</strong>,   <em class="m-text m-info">blue italics</em> and  <a href="https://mcss.mosra.cz" class="m-text m-big">https:/<wbr />/<wbr />mcss.mosra.cz</a> (big-ass link).</p><div class="m-button m-primary"><a href="#"><div class="m-big">A button</div> <div class="m-small"><span class="m-text m-em">with</span>  <strong class="m-text m-em">subtitle</strong></div></a></div><p>A paragraph that is not affected by the inline classes from above.</p><p class="m-text m-strong m-noindent">Bold, non-indented paragraph.</p><p class="m-text m-primary"><strong>Bold text that should not have</strong> the same class as the paragraph.</p><p>A paragraph that doesn&#x27;t have any class applied. Next, a full-width image:</p><img class="m-image m-fullwidth" src="ship-small.jpg" alt="Image" /><figure class="m-figure m-flat"><img src="ship-small.jpg" alt="Image" /><figcaption>A flat figure</figcaption></figure><p>A fullwidth table:</p><table class="m-table m-fullwidth"><thead><tr><th>Table header</th><th>Another</th></tr></thead><tbody><tr><td>Cell</td><td>Another cell</td></tr><tr><td>Next row</td><td>Last.</td></tr></tbody></table><p>An unstyled list:</p><ul class="m-unstyled"><li>First item without a dot</li><li>Second item without a dot</li></ul>
       </div>
     </div>
   </div>
index 538a295887cdecba28029b5651283d82f25552b5..a3e22a58fb8dc1a08afc16f9e6b0866d9da6f53e 100644 (file)
@@ -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} <a href="#">@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 </a> @m_enddiv
+
 A paragraph that is not affected by the inline classes from above.
 
 @m_class{m-text m-strong m-noindent}