From: Vladimír Vondruš Date: Thu, 13 Sep 2018 18:54:04 +0000 (+0200) Subject: doxygen: support \parblock. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=0436a4fe0fd5656d463ceecadf92f131e0a8e46b;p=blog.git doxygen: support \parblock. Uh, finally a
-like thing. --- diff --git a/doxygen/dox2html5.py b/doxygen/dox2html5.py index 655d1fc1..e5056442 100755 --- a/doxygen/dox2html5.py +++ b/doxygen/dox2html5.py @@ -558,6 +558,7 @@ def parse_desc_internal(state: State, element: ET.Element, immediate_parent: ET. # - # - (if not describing return type) and # - , (those are the same thing!) + # - (a weird grouping thing that we abuse for
s) # - , , # - , # - @@ -581,7 +582,7 @@ def parse_desc_internal(state: State, element: ET.Element, immediate_parent: ET. end_previous_paragraph = False # Straightforward elements - if i.tag in ['heading', 'blockquote', 'hruler', 'xrefsect', 'variablelist', 'verbatim', 'preformatted', 'itemizedlist', 'orderedlist', 'image', 'table', '{http://mcss.mosra.cz/doxygen/}div']: + if i.tag in ['heading', 'blockquote', 'hruler', 'xrefsect', 'variablelist', 'verbatim', 'parblock', 'preformatted', 'itemizedlist', 'orderedlist', 'image', 'table', '{http://mcss.mosra.cz/doxygen/}div']: end_previous_paragraph = True # describing return type is cut out of text flow, so @@ -764,6 +765,13 @@ def parse_desc_internal(state: State, element: ET.Element, immediate_parent: ET. out.parsed += '{1}'.format(h_tag_level, html.escape(i.text)) + elif i.tag == 'parblock': + assert element.tag == 'para' # is inside a paragraph :/ + has_block_elements = True + out.parsed += '{}'.format( + ' class="{}"'.format(add_css_class) if add_css_class else '', + parse_desc(state, i)) + elif i.tag == 'para': assert element.tag != 'para' # should be top-level block element paragraph_count += 1 diff --git a/doxygen/test/contents_blocks/index.html b/doxygen/test/contents_blocks/index.html index 6bf00668..da4fd88b 100644 --- a/doxygen/test/contents_blocks/index.html +++ b/doxygen/test/contents_blocks/index.html @@ -22,7 +22,7 @@

My Project

-

First paragraph containing some content.

Paragraph following the sections.

A blockquote

Text right after that blockquote should be a new paragraph.

  • A simple
  • List
    1. With one line
    2. for each
  • item, so paragraphs are removed
  • A simple
  • List
    1. With the sublist delimited
    2. by blank lines
  • should behave the same as above
  • A new list

    of multiple

    paragraphs.

  • Another item

    • A sub list

      Another paragraph

A paragraph after that list.

Table headerAnotherThird
CellAnother cell3rd
Next rowThis
is a tablereallyyes.
Table caption
Tablewith
tworow
tableheader

This is inside a paragraph.

+

First paragraph containing some content.

Paragraph following the sections.

A blockquote

Text right after that blockquote should be a new paragraph.

  • A simple
  • List
    1. With one line
    2. for each
  • item, so paragraphs are removed
  • A simple
  • List
    1. With the sublist delimited
    2. by blank lines
  • should behave the same as above
  • A new list

    of multiple

    paragraphs.

  • Another item

    • A sub list

      Another paragraph

A paragraph after that list.

Table headerAnotherThird
CellAnother cell3rd
Next rowThis
is a tablereallyyes.
Table caption
Tablewith
tworow
tableheader

This is inside a paragraph.

diff --git a/doxygen/test/contents_blocks/input.dox b/doxygen/test/contents_blocks/input.dox index 6cc99ec7..73440f5e 100644 --- a/doxygen/test/contents_blocks/input.dox +++ b/doxygen/test/contents_blocks/input.dox @@ -114,6 +114,13 @@ $Id: some strange RCS content $ @par Paragraph that adds to the previous + +@par Block title +@parblock +Hello! + +Here is something inside that paragraph block. +@endparblock */ /** @page other Other page