From: Vladimír Vondruš Date: Fri, 22 Feb 2019 23:49:01 +0000 (+0100) Subject: doxygen: support the \internal command. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=9c5b329e3a4acce7aaca540923989313d5730c2c;p=blog.git doxygen: support the \internal command. --- diff --git a/doxygen/dox2html5.py b/doxygen/dox2html5.py index 573d3e24..2ec89c44 100755 --- a/doxygen/dox2html5.py +++ b/doxygen/dox2html5.py @@ -1275,6 +1275,13 @@ def parse_desc_internal(state: State, element: ET.Element, immediate_parent: ET. assert element.tag in ['para', '{http://mcss.mosra.cz/doxygen/}div'] if i.text: out.parsed += i.text + # Internal docs, parse only if these are enabled + elif i.tag == 'internal': + if state.doxyfile['INTERNAL_DOCS']: + parsed = parse_desc_internal(state, i) + merge_parsed_subsections(parsed) + out.parsed += parsed.parsed + # Custom
with CSS classes (for making dim notes etc) elif i.tag == '{http://mcss.mosra.cz/doxygen/}div': has_block_elements = True @@ -3398,6 +3405,7 @@ copy a link to the result using ⌘ for i in ['CREATE_SUBDIRS', 'JAVADOC_AUTOBRIEF', 'QT_AUTOBRIEF', + 'INTERNAL_DOCS', 'SHOW_INCLUDE_FILES', 'M_EXPAND_INNER_TYPES', 'M_SEARCH_DISABLED', diff --git a/doxygen/test/contents_blocks/input.dox b/doxygen/test/contents_blocks/input.dox index 73353f1f..0f9c9356 100644 --- a/doxygen/test/contents_blocks/input.dox +++ b/doxygen/test/contents_blocks/input.dox @@ -124,6 +124,10 @@ Hello! Here is something inside that paragraph block. @endparblock + +@internal +This gets hidden because internal docs are not enabled by default. +@endinternal */ /** @page other Other page diff --git a/doxygen/test/contents_internal/Doxyfile b/doxygen/test/contents_internal/Doxyfile new file mode 100644 index 00000000..740b6ea1 --- /dev/null +++ b/doxygen/test/contents_internal/Doxyfile @@ -0,0 +1,15 @@ +INPUT = input.dox +QUIET = YES +GENERATE_HTML = NO +GENERATE_LATEX = NO +GENERATE_XML = YES +XML_PROGRAMLISTING = NO + +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_LINKS_NAVBAR1 = +##! M_LINKS_NAVBAR2 = +##! M_SEARCH_DISABLED = YES + +INTERNAL_DOCS = YES diff --git a/doxygen/test/contents_internal/index.html b/doxygen/test/contents_internal/index.html new file mode 100644 index 00000000..f1374d07 --- /dev/null +++ b/doxygen/test/contents_internal/index.html @@ -0,0 +1,31 @@ + + + + + My Project + + + + + +
+
+
+
+
+

+ My Project +

+

This is a normal text.

This is internal docs, which is shown because INTERNAL_DOCS are enabled.

This is public docs again.

+
+
+
+
+ + diff --git a/doxygen/test/contents_internal/input.dox b/doxygen/test/contents_internal/input.dox new file mode 100644 index 00000000..dfc8d602 --- /dev/null +++ b/doxygen/test/contents_internal/input.dox @@ -0,0 +1,10 @@ +/** @mainpage + +This is a normal text. + +@internal +This is internal docs, which is shown because `INTERNAL_DOCS` are enabled. +@endinternal + +This is public docs again. +*/ diff --git a/doxygen/test/test_contents.py b/doxygen/test/test_contents.py index f7905722..f6183ae4 100644 --- a/doxygen/test/test_contents.py +++ b/doxygen/test/test_contents.py @@ -70,6 +70,14 @@ class Blocks(IntegrationTestCase): self.assertEqual(*self.actual_expected_contents('todo.html', 'todo_1814.html')) self.assertEqual(*self.actual_expected_contents('old.html', 'old_1814.html')) +class Internal(IntegrationTestCase): + def __init__(self, *args, **kwargs): + super().__init__(__file__, 'internal', *args, **kwargs) + + def test(self): + self.run_dox2html5(wildcard='indexpage.xml') + self.assertEqual(*self.actual_expected_contents('index.html')) + class Code(IntegrationTestCase): def __init__(self, *args, **kwargs): super().__init__(__file__, 'code', *args, **kwargs)