chiark / gitweb /
doxygen: make it possible to abuse \par for a bigger m.css block.
authorVladimír Vondruš <mosra@centrum.cz>
Thu, 13 Sep 2018 18:55:33 +0000 (20:55 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Thu, 13 Sep 2018 19:27:40 +0000 (21:27 +0200)
doxygen/dox2html5.py
doxygen/test/contents_custom/index.html
doxygen/test/contents_custom/input.dox

index e50564428e5ff2b86904f7dbb9989967e231914b..602f6c2561aaa4a189ad10c28917ec8581c061c7 100755 (executable)
@@ -939,7 +939,10 @@ def parse_desc_internal(state: State, element: ET.Element, immediate_parent: ET.
                     elif i.attrib['kind'] == 'remark':
                         out.parsed += '<aside class="m-note m-default"><h4>Remark</h4>'
                     elif i.attrib['kind'] == 'par':
-                        out.parsed += '<aside class="m-note m-default"><h4>{}</h4>'.format(html.escape(i.findtext('title', '')))
+                        if add_css_class:
+                            out.parsed += '<aside class="{}"><h3>{}</h3>'.format(add_css_class, html.escape(i.findtext('title', '')))
+                        else:
+                            out.parsed += '<aside class="m-note m-default"><h4>{}</h4>'.format(html.escape(i.findtext('title', '')))
                     elif i.attrib['kind'] == 'rcs':
                         out.parsed += '<aside class="m-note m-default"><h4>{}</h4>'.format(html.escape(i.findtext('title', '')))
                     else: # pragma: no cover
index 800fa731ba92c3f7e9469a5f7b321c11909ea36b..251a84ee2eefa7ba2f68d3433ba08f330855c833 100644 (file)
@@ -22,7 +22,8 @@
         <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><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 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><aside class="m-block m-info"><h3>A info block with some paragraphs inside</h3><div><p>Hello.</p><p>This is good, finally.</p></div></aside><div class="m-code-figure"><pre class="m-code"><span class="c1">// this is the code</span>
+<span class="n">printf</span><span class="p">(</span><span class="s">&quot;The answer to the universe and everything is %d.&quot;</span><span class="p">,</span> <span class="mi">5</span><span class="o">*</span><span class="mi">9</span><span class="p">)</span></pre><p>The answer to the universe and everything is 42.</p></div>
       </div>
     </div>
   </div>
index a3e22a58fb8dc1a08afc16f9e6b0866d9da6f53e..a1f542ce158a97e8ce0f361ec72bcfb2a04a7331 100644 (file)
@@ -46,6 +46,26 @@ An unstyled list:
 -   First item without a dot
 -   Second item without a dot
 
+@m_class{m-block m-info}
+
+@par A info block with some paragraphs inside
+@parblock
+Hello.
+
+This is good, finally.
+@endparblock
+
+@m_class{m-code-figure}
+
+@parblock
+@code
+// this is the code
+printf("The answer to the universe and everything is %d.", 5*9)
+@endcode
+
+The answer to the universe and everything is 42.
+@endparblock
+
 */
 
 /** @page math Math