From: Vladimír Vondruš Date: Fri, 16 Nov 2018 21:13:51 +0000 (+0100) Subject: doxygen: make it possible to override styling of all blocks. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=92730fd4920e79de8d1ebf3dfa180d4c982914aa;p=blog.git doxygen: make it possible to override styling of all blocks. Finally I can have custom xrefitems. --- diff --git a/doc/doxygen.rst b/doc/doxygen.rst index f25dcfb0..fe5d687e 100644 --- a/doc/doxygen.rst +++ b/doc/doxygen.rst @@ -818,9 +818,33 @@ aliases however you want to fit your naming scheme. "m_enum_values_as_keywords=" With ``@m_class`` it's possible to add CSS classes to the immediately following -paragraph, image, table, list or math formula block. When used inline, it -affects the immediately following emphasis, strong text, link or inline math -formula. Example usage: +paragraph, image, table, list or math formula block. When used before a block +such as ``@par``, ``@note``, ``@see`` or ``@xrefitem``, the CSS class fully +overrides the block styling. By default :css:`.m-note` with some color and +:html:`

` is used, with ``@m_class`` before it get :html:`

` for the +title and you can turn it into a block, for example: + +.. code-figure:: + + .. code:: c++ + + /** + @m_class{m-block m-success} + + @par Third-party license info + This utility depends on the [Magnum engine](https://magnum.graphics). + It's licensed under MIT, so all you need to do is mention it in the + credits of your commercial app. + */ + + .. block-success:: Third-party license info + + This utility depends on the `Magnum engine `_. + It's licensed under MIT, so all you need to do is mention it in the + credits of your commercial app. + +When used inline, it affects the immediately following emphasis, strong text, +link or inline math formula. Example usage: .. code-figure:: diff --git a/doxygen/dox2html5.py b/doxygen/dox2html5.py index 8b4b3215..a6f35ec3 100755 --- a/doxygen/dox2html5.py +++ b/doxygen/dox2html5.py @@ -921,44 +921,73 @@ def parse_desc_internal(state: State, element: ET.Element, immediate_parent: ET. # Not continuing with a section from before, put a header in if not previous_section or (i.attrib['kind'] != 'par' and previous_section != i.attrib['kind']) or (i.attrib['kind'] == 'par' and i.find('title').text): if i.attrib['kind'] == 'see': - out.parsed += '