From: Vladimír Vondruš Date: Sun, 17 Jun 2018 10:53:06 +0000 (+0200) Subject: doxygen: make it possible to hide m.css options from Doxygen. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=c238d5bc27afd5e4bef33a21a5edad4e6948515d;p=blog.git doxygen: make it possible to hide m.css options from Doxygen. Makes the output finally bearable. --- diff --git a/doc/doxygen.rst b/doc/doxygen.rst index f910c5bd..93acdba1 100644 --- a/doc/doxygen.rst +++ b/doc/doxygen.rst @@ -347,6 +347,19 @@ Variable Description Note that namespace, directory and page lists are always fully expanded as these are not expected to be excessively large. +.. block-success:: Hiding extra options from Doxygen + + Doxygen complains on unknown options, so it's possible to add them + prefixed with ``##!``. Line continuations are supported too, using ``##!`` + ensures that the options also survive Doxyfile upgrades using + ``doxygen -u`` (which is not the case when the options would be specified + directly): + + .. code:: ini + + ##! M_LINKS_NAVBAR1 = pages \ + ##! modules + `Theme selection`_ ------------------ diff --git a/doxygen/dox2html5.py b/doxygen/dox2html5.py index 7d06c56f..8efd03e0 100755 --- a/doxygen/dox2html5.py +++ b/doxygen/dox2html5.py @@ -2724,9 +2724,9 @@ def parse_doxyfile(state: State, doxyfile, config = None): logging.debug("Parsing configuration from {}".format(doxyfile)) comment_re = re.compile(r"""^\s*(#.*)?$""") - variable_re = re.compile(r"""^\s*(?P[A-Z0-9_@]+)\s*=\s*(?P['"]?)(?P.*)(?P=quote)\s*(?P\\?)$""") - variable_continuation_re = re.compile(r"""^\s*(?P[A-Z_]+)\s*\+=\s*(?P['"]?)(?P.*)(?P=quote)\s*(?P\\?)$""") - continuation_re = re.compile(r"""^\s*(?P['"]?)(?P.*)(?P=quote)\s*(?P\\?)$""") + variable_re = re.compile(r"""^\s*(##!\s*)?(?P[A-Z0-9_@]+)\s*=\s*(?P['"]?)(?P.*)(?P=quote)\s*(?P\\?)$""") + variable_continuation_re = re.compile(r"""^\s*(##!\s*)?(?P[A-Z_]+)\s*\+=\s*(?P['"]?)(?P.*)(?P=quote)\s*(?P\\?)$""") + continuation_re = re.compile(r"""^\s*(##!\s*)?(?P['"]?)(?P.*)(?P=quote)\s*(?P\\?)$""") default_config = { 'PROJECT_NAME': ['My Project'], @@ -2786,13 +2786,9 @@ list using and for line in f: line = line.strip() - # Ignore comments and empty lines. Comment also stops line - # continuation - if comment_re.match(line): - continued_line = None - continue - - # Line continuation from before, append the line contents to it + # Line continuation from before, append the line contents to it. + # Needs to be before variable so variable-looking continuations + # are not parsed as variables. if continued_line: var = continuation_re.match(line) value, backslash = parse_value(var) @@ -2828,6 +2824,13 @@ list using and # only because coverage.py can't handle continue continue # pragma: no cover + # Ignore comments and empty lines. Comment also stops line + # continuation. Has to be last because variables can be inside + # comments. + if comment_re.match(line): + continued_line = None + continue + logging.warning("{}: unmatchable line {}".format(doxyfile, line)) # pragma: no cover # Some values are set to empty in the default-generated Doxyfile but they diff --git a/doxygen/test/compound_deprecated/Doxyfile b/doxygen/test/compound_deprecated/Doxyfile index 253fe335..796610f6 100644 --- a/doxygen/test/compound_deprecated/Doxyfile +++ b/doxygen/test/compound_deprecated/Doxyfile @@ -7,9 +7,9 @@ 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 +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_LINKS_NAVBAR1 = +##! M_LINKS_NAVBAR2 = +##! M_SEARCH_DISABLED = YES diff --git a/doxygen/test/compound_detailed/Doxyfile b/doxygen/test/compound_detailed/Doxyfile index 97f2af0d..162364c7 100644 --- a/doxygen/test/compound_detailed/Doxyfile +++ b/doxygen/test/compound_detailed/Doxyfile @@ -6,9 +6,9 @@ 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 +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_LINKS_NAVBAR1 = +##! M_LINKS_NAVBAR2 = +##! M_SEARCH_DISABLED = YES diff --git a/doxygen/test/compound_filename_case/Doxyfile b/doxygen/test/compound_filename_case/Doxyfile index 698cbd7f..6022a7a6 100644 --- a/doxygen/test/compound_filename_case/Doxyfile +++ b/doxygen/test/compound_filename_case/Doxyfile @@ -6,11 +6,11 @@ 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 +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_LINKS_NAVBAR1 = +##! M_LINKS_NAVBAR2 = +##! M_SEARCH_DISABLED = YES CASE_SENSE_NAMES = NO diff --git a/doxygen/test/compound_ignored/Doxyfile b/doxygen/test/compound_ignored/Doxyfile index c90f097a..519b0031 100644 --- a/doxygen/test/compound_ignored/Doxyfile +++ b/doxygen/test/compound_ignored/Doxyfile @@ -5,9 +5,9 @@ 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 +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_LINKS_NAVBAR1 = +##! M_LINKS_NAVBAR2 = +##! M_SEARCH_DISABLED = YES diff --git a/doxygen/test/compound_listing/Doxyfile b/doxygen/test/compound_listing/Doxyfile index 2d8ac5a0..fd4fcb03 100644 --- a/doxygen/test/compound_listing/Doxyfile +++ b/doxygen/test/compound_listing/Doxyfile @@ -8,11 +8,11 @@ GENERATE_LATEX = NO GENERATE_XML = YES XML_PROGRAMLISTING = NO -M_FILE_TREE_EXPAND_LEVELS = 2 -M_CLASS_TREE_EXPAND_LEVELS = 5 -M_EXPAND_INNER_TYPES = YES -M_PAGE_FINE_PRINT = -M_THEME_COLOR = -M_FAVICON = -M_SEARCH_DISABLED = YES +##! M_FILE_TREE_EXPAND_LEVELS = 2 +##! M_CLASS_TREE_EXPAND_LEVELS = 5 +##! M_EXPAND_INNER_TYPES = YES +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_SEARCH_DISABLED = YES # Keeping navbar enabled so we can test for highlighted items diff --git a/doxygen/test/compound_modules/Doxyfile b/doxygen/test/compound_modules/Doxyfile index 1c8867f5..f0d7cb56 100644 --- a/doxygen/test/compound_modules/Doxyfile +++ b/doxygen/test/compound_modules/Doxyfile @@ -5,9 +5,9 @@ GENERATE_LATEX = NO GENERATE_XML = YES XML_PROGRAMLISTING = NO -M_PAGE_FINE_PRINT = -M_THEME_COLOR = -M_FAVICON = -M_LINKS_NAVBAR1 = modules -M_LINKS_NAVBAR2 = -M_SEARCH_DISABLED = YES +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_LINKS_NAVBAR1 = modules +##! M_LINKS_NAVBAR2 = +##! M_SEARCH_DISABLED = YES diff --git a/doxygen/test/compound_namespace_members_in_file_scope/Doxyfile b/doxygen/test/compound_namespace_members_in_file_scope/Doxyfile index a89bef49..cd500a22 100644 --- a/doxygen/test/compound_namespace_members_in_file_scope/Doxyfile +++ b/doxygen/test/compound_namespace_members_in_file_scope/Doxyfile @@ -6,9 +6,9 @@ GENERATE_XML = YES XML_PROGRAMLISTING = NO XML_NAMESPACE_MEMBERS_IN_FILE_SCOPE = YES -M_PAGE_FINE_PRINT = -M_THEME_COLOR = -M_FAVICON = -M_LINKS_NAVBAR1 = -M_LINKS_NAVBAR2 = -M_SEARCH_DISABLED = YES +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_LINKS_NAVBAR1 = +##! M_LINKS_NAVBAR2 = +##! M_SEARCH_DISABLED = YES diff --git a/doxygen/test/compound_warnings/Doxyfile b/doxygen/test/compound_warnings/Doxyfile index 118631ca..8d9fcf9a 100644 --- a/doxygen/test/compound_warnings/Doxyfile +++ b/doxygen/test/compound_warnings/Doxyfile @@ -9,9 +9,9 @@ PREDEFINED = DOXYGEN_GENERATING_OUTPUT # Enable to get rid of the MAGNUM_EXPORT macro in the output # MACRO_EXPANSION = YES -M_PAGE_FINE_PRINT = -M_THEME_COLOR = -M_FAVICON = -M_LINKS_NAVBAR1 = -M_LINKS_NAVBAR2 = -M_SEARCH_DISABLED = YES +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_LINKS_NAVBAR1 = +##! M_LINKS_NAVBAR2 = +##! M_SEARCH_DISABLED = YES diff --git a/doxygen/test/contents_anchor_in_both_group_and_namespace/Doxyfile b/doxygen/test/contents_anchor_in_both_group_and_namespace/Doxyfile index 5945b1ee..1edb6422 100644 --- a/doxygen/test/contents_anchor_in_both_group_and_namespace/Doxyfile +++ b/doxygen/test/contents_anchor_in_both_group_and_namespace/Doxyfile @@ -5,10 +5,10 @@ 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 +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_LINKS_NAVBAR1 = +##! M_LINKS_NAVBAR2 = +##! M_SEARCH_DISABLED = YES diff --git a/doxygen/test/contents_autobrief_heading/Doxyfile b/doxygen/test/contents_autobrief_heading/Doxyfile index a514ba2d..c46c83db 100644 --- a/doxygen/test/contents_autobrief_heading/Doxyfile +++ b/doxygen/test/contents_autobrief_heading/Doxyfile @@ -5,12 +5,12 @@ 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 +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_LINKS_NAVBAR1 = +##! M_LINKS_NAVBAR2 = +##! M_SEARCH_DISABLED = YES # So the ==== is treated as brief. Ugh. JAVADOC_AUTOBRIEF = YES diff --git a/doxygen/test/contents_autobrief_hr/Doxyfile b/doxygen/test/contents_autobrief_hr/Doxyfile index 19191876..d1754a25 100644 --- a/doxygen/test/contents_autobrief_hr/Doxyfile +++ b/doxygen/test/contents_autobrief_hr/Doxyfile @@ -5,12 +5,12 @@ 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 +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_LINKS_NAVBAR1 = +##! M_LINKS_NAVBAR2 = +##! M_SEARCH_DISABLED = YES # So the comment on top is treated as a brief JAVADOC_AUTOBRIEF = YES diff --git a/doxygen/test/contents_autobrief_multiline/Doxyfile b/doxygen/test/contents_autobrief_multiline/Doxyfile index 460cc7c5..ea2cd728 100644 --- a/doxygen/test/contents_autobrief_multiline/Doxyfile +++ b/doxygen/test/contents_autobrief_multiline/Doxyfile @@ -5,12 +5,12 @@ 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 +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_LINKS_NAVBAR1 = +##! M_LINKS_NAVBAR2 = +##! M_SEARCH_DISABLED = YES # So the two lines on top are treated as brief. Wtf. JAVADOC_AUTOBRIEF = YES diff --git a/doxygen/test/contents_blocks/Doxyfile b/doxygen/test/contents_blocks/Doxyfile index d2fcc288..b020f242 100644 --- a/doxygen/test/contents_blocks/Doxyfile +++ b/doxygen/test/contents_blocks/Doxyfile @@ -5,9 +5,9 @@ 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 +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_LINKS_NAVBAR1 = +##! M_LINKS_NAVBAR2 = +##! M_SEARCH_DISABLED = YES diff --git a/doxygen/test/contents_code/Doxyfile b/doxygen/test/contents_code/Doxyfile index 898e7d00..f402b59a 100644 --- a/doxygen/test/contents_code/Doxyfile +++ b/doxygen/test/contents_code/Doxyfile @@ -6,9 +6,9 @@ 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 +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_LINKS_NAVBAR1 = +##! M_LINKS_NAVBAR2 = +##! M_SEARCH_DISABLED = YES diff --git a/doxygen/test/contents_code_language/Doxyfile b/doxygen/test/contents_code_language/Doxyfile index 898e7d00..f402b59a 100644 --- a/doxygen/test/contents_code_language/Doxyfile +++ b/doxygen/test/contents_code_language/Doxyfile @@ -6,9 +6,9 @@ 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 +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_LINKS_NAVBAR1 = +##! M_LINKS_NAVBAR2 = +##! M_SEARCH_DISABLED = YES diff --git a/doxygen/test/contents_custom/Doxyfile b/doxygen/test/contents_custom/Doxyfile index ecc3d464..a2cb09dc 100644 --- a/doxygen/test/contents_custom/Doxyfile +++ b/doxygen/test/contents_custom/Doxyfile @@ -6,13 +6,13 @@ 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_MATH_CACHE_FILE = -M_SEARCH_DISABLED = YES +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_LINKS_NAVBAR1 = +##! M_LINKS_NAVBAR2 = +##! M_MATH_CACHE_FILE = +##! M_SEARCH_DISABLED = YES ALIASES = \ "m_div{1}=@xmlonly@endxmlonly" \ diff --git a/doxygen/test/contents_image/Doxyfile b/doxygen/test/contents_image/Doxyfile index b6f89acf..abfef1b7 100644 --- a/doxygen/test/contents_image/Doxyfile +++ b/doxygen/test/contents_image/Doxyfile @@ -6,9 +6,9 @@ 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 +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_LINKS_NAVBAR1 = +##! M_LINKS_NAVBAR2 = +##! M_SEARCH_DISABLED = YES diff --git a/doxygen/test/contents_math/Doxyfile b/doxygen/test/contents_math/Doxyfile index 59c69bc4..a36ea8d1 100644 --- a/doxygen/test/contents_math/Doxyfile +++ b/doxygen/test/contents_math/Doxyfile @@ -5,10 +5,10 @@ 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 -M_MATH_CACHE_FILE = +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_LINKS_NAVBAR1 = +##! M_LINKS_NAVBAR2 = +##! M_SEARCH_DISABLED = YES +##! M_MATH_CACHE_FILE = diff --git a/doxygen/test/contents_math_cached/Doxyfile b/doxygen/test/contents_math_cached/Doxyfile index 933dfe74..cbd40785 100644 --- a/doxygen/test/contents_math_cached/Doxyfile +++ b/doxygen/test/contents_math_cached/Doxyfile @@ -5,10 +5,10 @@ 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 -M_MATH_CACHE_FILE = xml/math.cache +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_LINKS_NAVBAR1 = +##! M_LINKS_NAVBAR2 = +##! M_SEARCH_DISABLED = YES +##! M_MATH_CACHE_FILE = xml/math.cache diff --git a/doxygen/test/contents_section_in_function/Doxyfile b/doxygen/test/contents_section_in_function/Doxyfile index 471f68b7..49e476ec 100644 --- a/doxygen/test/contents_section_in_function/Doxyfile +++ b/doxygen/test/contents_section_in_function/Doxyfile @@ -5,9 +5,9 @@ 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 +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_LINKS_NAVBAR1 = +##! M_LINKS_NAVBAR2 = +##! M_SEARCH_DISABLED = YES diff --git a/doxygen/test/contents_section_underscore_one/Doxyfile b/doxygen/test/contents_section_underscore_one/Doxyfile index d1b0fce7..7705c563 100644 --- a/doxygen/test/contents_section_underscore_one/Doxyfile +++ b/doxygen/test/contents_section_underscore_one/Doxyfile @@ -5,9 +5,9 @@ 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 +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_LINKS_NAVBAR1 = +##! M_LINKS_NAVBAR2 = +##! M_SEARCH_DISABLED = YES diff --git a/doxygen/test/contents_tagfile/Doxyfile b/doxygen/test/contents_tagfile/Doxyfile index 1d443307..fa4481d6 100644 --- a/doxygen/test/contents_tagfile/Doxyfile +++ b/doxygen/test/contents_tagfile/Doxyfile @@ -6,9 +6,9 @@ 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 +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_LINKS_NAVBAR1 = +##! M_LINKS_NAVBAR2 = +##! M_SEARCH_DISABLED = YES diff --git a/doxygen/test/contents_typography/Doxyfile b/doxygen/test/contents_typography/Doxyfile index d1b0fce7..7705c563 100644 --- a/doxygen/test/contents_typography/Doxyfile +++ b/doxygen/test/contents_typography/Doxyfile @@ -5,9 +5,9 @@ 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 +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_LINKS_NAVBAR1 = +##! M_LINKS_NAVBAR2 = +##! M_SEARCH_DISABLED = YES diff --git a/doxygen/test/cpp_derived/Doxyfile b/doxygen/test/cpp_derived/Doxyfile index fe6d3cfb..ee1cb763 100644 --- a/doxygen/test/cpp_derived/Doxyfile +++ b/doxygen/test/cpp_derived/Doxyfile @@ -6,9 +6,9 @@ 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 +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_LINKS_NAVBAR1 = +##! M_LINKS_NAVBAR2 = +##! M_SEARCH_DISABLED = YES diff --git a/doxygen/test/cpp_enum_class/Doxyfile b/doxygen/test/cpp_enum_class/Doxyfile index 97f2af0d..162364c7 100644 --- a/doxygen/test/cpp_enum_class/Doxyfile +++ b/doxygen/test/cpp_enum_class/Doxyfile @@ -6,9 +6,9 @@ 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 +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_LINKS_NAVBAR1 = +##! M_LINKS_NAVBAR2 = +##! M_SEARCH_DISABLED = YES diff --git a/doxygen/test/cpp_template_alias/Doxyfile b/doxygen/test/cpp_template_alias/Doxyfile index 97f2af0d..162364c7 100644 --- a/doxygen/test/cpp_template_alias/Doxyfile +++ b/doxygen/test/cpp_template_alias/Doxyfile @@ -6,9 +6,9 @@ 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 +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_LINKS_NAVBAR1 = +##! M_LINKS_NAVBAR2 = +##! M_SEARCH_DISABLED = YES diff --git a/doxygen/test/doxyfile/Doxyfile b/doxygen/test/doxyfile/Doxyfile index eb8f8d1e..8c9510eb 100644 --- a/doxygen/test/doxyfile/Doxyfile +++ b/doxygen/test/doxyfile/Doxyfile @@ -18,3 +18,11 @@ HTML_EXTRA_STYLESHEET += b.css # Escaping M_PAGE_HEADER = 'this is "quotes" \'apostrophes\'' M_PAGE_FINE_PRINT = "this is \"quotes\"" + +# Commented with a hashbang +##! M_LINKS_NAVBAR1 = pages \ +##! modules + +# Commented with a hashbang and no space +##!M_LINKS_NAVBAR2 = files \ +##!annotated diff --git a/doxygen/test/doxyfile_upgrade_custom_variables/.gitignore b/doxygen/test/doxyfile_upgrade_custom_variables/.gitignore new file mode 100644 index 00000000..b655f1a0 --- /dev/null +++ b/doxygen/test/doxyfile_upgrade_custom_variables/.gitignore @@ -0,0 +1,2 @@ +Doxyfile-upgrade +Doxyfile-upgrade.bak diff --git a/doxygen/test/doxyfile_upgrade_custom_variables/Doxyfile b/doxygen/test/doxyfile_upgrade_custom_variables/Doxyfile new file mode 100644 index 00000000..0a664a19 --- /dev/null +++ b/doxygen/test/doxyfile_upgrade_custom_variables/Doxyfile @@ -0,0 +1,21 @@ +# This variable is unknown to Doxygen and so it doesn't survive an upgrade +UNKNOWN_VARIABLE = 1 + +# COMMENTED_OUT_VARIABLE is commented-out, so it also doesn't survive + +# This one will survive, but is not recognized by m.css +## HASHED_COMMENTED_VARIABLE = 2 + +# This one is recognized by m.css and will survive, both lines +##! HASHED_BANG_COMMENTED_VARIABLE = 3 \ +##! HASHED_BANG_COMMENTED_VARIABLE_CONT + +# This one should also survive +##!HASHED_BANG_COMMENTED_VARIABLE_NOSPACE = 4 + +# This is known to Doxygen. It puts heavy spacing there though. +INPUT = 5 + +# This is at the end of the file (doesn't precede any known variable), but also +# should survive +##! HASHED_BANG_COMMENTED_VARIABLE_END = 6 diff --git a/doxygen/test/example/Doxyfile b/doxygen/test/example/Doxyfile index 20c2486a..0c683e31 100644 --- a/doxygen/test/example/Doxyfile +++ b/doxygen/test/example/Doxyfile @@ -9,9 +9,9 @@ ALIASES = \ "m_footernavigation=@xmlonly@endxmlonly" \ "m_examplenavigation{2}=@xmlonly@endxmlonly" -M_PAGE_FINE_PRINT = -M_THEME_COLOR = -M_FAVICON = -M_LINKS_NAVBAR1 = -M_LINKS_NAVBAR2 = -M_SEARCH_DISABLED = YES +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_LINKS_NAVBAR1 = +##! M_LINKS_NAVBAR2 = +##! M_SEARCH_DISABLED = YES diff --git a/doxygen/test/layout/Doxyfile b/doxygen/test/layout/Doxyfile index 364fcdfe..0db4bb1d 100644 --- a/doxygen/test/layout/Doxyfile +++ b/doxygen/test/layout/Doxyfile @@ -3,12 +3,12 @@ XML_OUTPUT = PROJECT_NAME = "A project" PROJECT_BRIEF = "is cool" -M_THEME_COLOR = 00ffff -M_FAVICON = favicon-light.png -M_PAGE_HEADER = "

A self link.

" -M_PAGE_FINE_PRINT = "

Doxygen version {doxygen_version}.

" -M_LINKS_NAVBAR1 = "files pages namespaces" \ - "annotated namespaces pages" -M_LINKS_NAVBAR2 = "pages pages annotated" -M_SEARCH_EXTERNAL_URL = "https://google.com/search?q=site:mcss.mosra.cz+{}" -M_SEARCH_HELP = "Some help." +##! M_THEME_COLOR = 00ffff +##! M_FAVICON = favicon-light.png +##! M_PAGE_HEADER = "

A self link.

" +##! M_PAGE_FINE_PRINT = "

Doxygen version {doxygen_version}.

" +##! M_LINKS_NAVBAR1 = "files pages namespaces" \ +##! "annotated namespaces pages" +##! M_LINKS_NAVBAR2 = "pages pages annotated" +##! M_SEARCH_EXTERNAL_URL = "https://google.com/search?q=site:mcss.mosra.cz+{}" +##! M_SEARCH_HELP = "Some help." diff --git a/doxygen/test/layout_navbar_single_column/Doxyfile b/doxygen/test/layout_navbar_single_column/Doxyfile index 589305b6..d606ff02 100644 --- a/doxygen/test/layout_navbar_single_column/Doxyfile +++ b/doxygen/test/layout_navbar_single_column/Doxyfile @@ -1,11 +1,11 @@ XML_OUTPUT = -M_LINKS_NAVBAR1 = pages \ - namespaces \ - annotated \ - files -M_LINKS_NAVBAR2 = -M_PAGE_FINE_PRINT = -M_THEME_COLOR = -M_FAVICON = -M_SEARCH_DISABLED = YES +##! M_LINKS_NAVBAR1 = pages \ +##! namespaces \ +##! annotated \ +##! files +##! M_LINKS_NAVBAR2 = +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_SEARCH_DISABLED = YES diff --git a/doxygen/test/layout_search_binary/Doxyfile b/doxygen/test/layout_search_binary/Doxyfile index 2adc63d6..49ceace4 100644 --- a/doxygen/test/layout_search_binary/Doxyfile +++ b/doxygen/test/layout_search_binary/Doxyfile @@ -1,9 +1,9 @@ XML_OUTPUT = -M_PAGE_FINE_PRINT = -M_THEME_COLOR = -M_FAVICON = -M_LINKS_NAVBAR1 = -M_LINKS_NAVBAR2 = -M_SEARCH_DOWNLOAD_BINARY = YES -M_SEARCH_HELP = "Halp." +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_LINKS_NAVBAR1 = +##! M_LINKS_NAVBAR2 = +##! M_SEARCH_DOWNLOAD_BINARY = YES +##! M_SEARCH_HELP = "Halp." diff --git a/doxygen/test/page_brief/Doxyfile b/doxygen/test/page_brief/Doxyfile index d1b0fce7..7705c563 100644 --- a/doxygen/test/page_brief/Doxyfile +++ b/doxygen/test/page_brief/Doxyfile @@ -5,9 +5,9 @@ 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 +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_LINKS_NAVBAR1 = +##! M_LINKS_NAVBAR2 = +##! M_SEARCH_DISABLED = YES diff --git a/doxygen/test/page_empty_index/Doxyfile b/doxygen/test/page_empty_index/Doxyfile index d1b0fce7..7705c563 100644 --- a/doxygen/test/page_empty_index/Doxyfile +++ b/doxygen/test/page_empty_index/Doxyfile @@ -5,9 +5,9 @@ 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 +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_LINKS_NAVBAR1 = +##! M_LINKS_NAVBAR2 = +##! M_SEARCH_DISABLED = YES diff --git a/doxygen/test/page_empty_title/Doxyfile b/doxygen/test/page_empty_title/Doxyfile index d1b0fce7..7705c563 100644 --- a/doxygen/test/page_empty_title/Doxyfile +++ b/doxygen/test/page_empty_title/Doxyfile @@ -5,9 +5,9 @@ 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 +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_LINKS_NAVBAR1 = +##! M_LINKS_NAVBAR2 = +##! M_SEARCH_DISABLED = YES diff --git a/doxygen/test/page_footernavigation/Doxyfile b/doxygen/test/page_footernavigation/Doxyfile index c6dc3fbd..455fa33d 100644 --- a/doxygen/test/page_footernavigation/Doxyfile +++ b/doxygen/test/page_footernavigation/Doxyfile @@ -6,12 +6,12 @@ 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 +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_LINKS_NAVBAR1 = +##! M_LINKS_NAVBAR2 = +##! M_SEARCH_DISABLED = YES ALIASES = \ "m_footernavigation=@xmlonly@endxmlonly" diff --git a/doxygen/test/page_in_navbar/Doxyfile b/doxygen/test/page_in_navbar/Doxyfile index fac82ea9..eae6dcfd 100644 --- a/doxygen/test/page_in_navbar/Doxyfile +++ b/doxygen/test/page_in_navbar/Doxyfile @@ -5,11 +5,11 @@ GENERATE_LATEX = NO GENERATE_XML = YES XML_PROGRAMLISTING = NO -M_PAGE_FINE_PRINT = -M_THEME_COLOR = -M_FAVICON = -M_LINKS_NAVBAR1 = "page-in-navbar pages page-b" \ - "page-b" -M_LINKS_NAVBAR2 = "page-b" \ - "page-in-navbar page-b files" -M_SEARCH_DISABLED = YES +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_LINKS_NAVBAR1 = "page-in-navbar pages page-b" \ +##! "page-b" +##! M_LINKS_NAVBAR2 = "page-b" \ +##! "page-in-navbar page-b files" +##! M_SEARCH_DISABLED = YES diff --git a/doxygen/test/page_order/Doxyfile b/doxygen/test/page_order/Doxyfile index c99c91e6..e2601c1b 100644 --- a/doxygen/test/page_order/Doxyfile +++ b/doxygen/test/page_order/Doxyfile @@ -6,9 +6,9 @@ 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 +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_LINKS_NAVBAR1 = +##! M_LINKS_NAVBAR2 = +##! M_SEARCH_DISABLED = YES diff --git a/doxygen/test/page_subpage_of_index/Doxyfile b/doxygen/test/page_subpage_of_index/Doxyfile index d1b0fce7..7705c563 100644 --- a/doxygen/test/page_subpage_of_index/Doxyfile +++ b/doxygen/test/page_subpage_of_index/Doxyfile @@ -5,9 +5,9 @@ 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 +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_LINKS_NAVBAR1 = +##! M_LINKS_NAVBAR2 = +##! M_SEARCH_DISABLED = YES diff --git a/doxygen/test/page_toc/Doxyfile b/doxygen/test/page_toc/Doxyfile index d1b0fce7..7705c563 100644 --- a/doxygen/test/page_toc/Doxyfile +++ b/doxygen/test/page_toc/Doxyfile @@ -5,9 +5,9 @@ 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 +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_LINKS_NAVBAR1 = +##! M_LINKS_NAVBAR2 = +##! M_SEARCH_DISABLED = YES diff --git a/doxygen/test/search/Doxyfile b/doxygen/test/search/Doxyfile index a2da4c68..a87b24c9 100644 --- a/doxygen/test/search/Doxyfile +++ b/doxygen/test/search/Doxyfile @@ -14,9 +14,9 @@ ALIASES = \ "m_keyword{3}=@xmlonly@endxmlonly" \ "m_enum_values_as_keywords=@xmlonly@endxmlonly" -M_PAGE_FINE_PRINT = -M_THEME_COLOR = -M_FAVICON = -M_LINKS_NAVBAR1 = -M_LINKS_NAVBAR2 = -M_SEARCH_DOWNLOAD_BINARY = YES +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_LINKS_NAVBAR1 = +##! M_LINKS_NAVBAR2 = +##! M_SEARCH_DOWNLOAD_BINARY = YES diff --git a/doxygen/test/search_long_suffix_length/Doxyfile b/doxygen/test/search_long_suffix_length/Doxyfile index 44b01a48..2678b4a3 100644 --- a/doxygen/test/search_long_suffix_length/Doxyfile +++ b/doxygen/test/search_long_suffix_length/Doxyfile @@ -5,9 +5,9 @@ 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_DOWNLOAD_BINARY = YES +##! M_PAGE_FINE_PRINT = +##! M_THEME_COLOR = +##! M_FAVICON = +##! M_LINKS_NAVBAR1 = +##! M_LINKS_NAVBAR2 = +##! M_SEARCH_DOWNLOAD_BINARY = YES diff --git a/doxygen/test/test_doxyfile.py b/doxygen/test/test_doxyfile.py index e058b083..a86a0311 100644 --- a/doxygen/test/test_doxyfile.py +++ b/doxygen/test/test_doxyfile.py @@ -22,10 +22,15 @@ # DEALINGS IN THE SOFTWARE. # +import os +import shutil +import subprocess import unittest from dox2html5 import parse_doxyfile, State +from . import BaseTestCase + class Doxyfile(unittest.TestCase): def __init__(self, *args, **kwargs): unittest.TestCase.__init__(self, *args, **kwargs) @@ -44,8 +49,8 @@ class Doxyfile(unittest.TestCase): 'M_EXPAND_INNER_TYPES': False, 'M_FAVICON': 'favicon-dark.png', 'M_FILE_TREE_EXPAND_LEVELS': 1, - 'M_LINKS_NAVBAR1': ['pages', 'namespaces'], - 'M_LINKS_NAVBAR2': ['annotated', 'files'], + 'M_LINKS_NAVBAR1': ['pages', 'modules'], + 'M_LINKS_NAVBAR2': ['files', 'annotated'], # different order 'M_MATH_CACHE_FILE': 'm.math.cache', 'M_PAGE_FINE_PRINT': 'this is "quotes"', 'M_PAGE_HEADER': 'this is "quotes" \'apostrophes\'', @@ -70,3 +75,25 @@ list using and state = State() with self.assertRaises(NotImplementedError): parse_doxyfile(state, 'test/doxyfile/Doxyfile-subdirs') + +class Upgrade(BaseTestCase): + def __init__(self, *args, **kwargs): + super().__init__(__file__, 'upgrade_custom_variables', *args, **kwargs) + + def test(self): + # Copy the Doxyfile to a new location because it gets overwritten + shutil.copyfile(os.path.join(self.path, 'Doxyfile'), + os.path.join(self.path, 'Doxyfile-upgrade')) + + subprocess.run(['doxygen', '-u', 'Doxyfile-upgrade'], cwd=self.path) + with open(os.path.join(self.path, 'Doxyfile-upgrade'), 'r') as f: + contents = f.read() + + self.assertFalse('UNKNOWN_VARIABLE' in contents) + self.assertFalse('COMMENTED_OUT_VARIABLE' in contents) + self.assertTrue('## HASHED_COMMENTED_VARIABLE = 2' in contents) + self.assertTrue('##! HASHED_BANG_COMMENTED_VARIABLE = 3 \\' in contents) + self.assertTrue('##! HASHED_BANG_COMMENTED_VARIABLE_CONT' in contents) + self.assertTrue('##!HASHED_BANG_COMMENTED_VARIABLE_NOSPACE = 4' in contents) + self.assertTrue('INPUT = 5' in contents) + self.assertTrue('##! HASHED_BANG_COMMENTED_VARIABLE_END = 6' in contents)