From ba7894fca4a5e15734f4014452e2030b5018936d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 2 Jul 2022 16:32:31 +0100 Subject: [PATCH] Disable custom Doxygen theme support for CHM generation Unsurprisingly, this doesn't work at all with CHM, so allow disabling using the custom theme when doing it by adding more custom variables. Using (multiple) variables for this is rather ugly, but we already use them for other options, so it seems better to keep adding them rather than using some other mechanism. Adding a different custom header file is even uglier, but it seems to be the only way to avoid including the theme JS files into CHM. --- docs/doxygen/Doxyfile | 11 +++---- docs/doxygen/custom_header_simple.html | 45 ++++++++++++++++++++++++++ docs/doxygen/regen.bat | 9 ++++-- docs/doxygen/regen.sh | 8 +++++ 4 files changed, 63 insertions(+), 10 deletions(-) create mode 100644 docs/doxygen/custom_header_simple.html diff --git a/docs/doxygen/Doxyfile b/docs/doxygen/Doxyfile index 2f3e0360c8..67f7d24bdf 100644 --- a/docs/doxygen/Doxyfile +++ b/docs/doxygen/Doxyfile @@ -353,14 +353,11 @@ IGNORE_PREFIX = wx GENERATE_HTML = $(GENERATE_HTML) HTML_OUTPUT = $(WX_HTML_OUTPUT_DIR) HTML_FILE_EXTENSION = .html -HTML_HEADER = custom_header.html +HTML_HEADER = $(HTML_HEADER) HTML_FOOTER = custom_footer.html HTML_STYLESHEET = -HTML_EXTRA_STYLESHEET = doxygen-awesome-css/doxygen-awesome.css \ - extra_stylesheet.css -HTML_EXTRA_FILES = doxygen-awesome-css/doxygen-awesome-darkmode-toggle.js \ - doxygen-awesome-css/doxygen-awesome-fragment-copy-button.js \ - wxwidgets.js +HTML_EXTRA_STYLESHEET = $(CUSTOM_THEME_CSS) extra_stylesheet.css +HTML_EXTRA_FILES = $(CUSTOM_THEME_JS1) $(CUSTOM_THEME_JS2) wxwidgets.js HTML_COLORSTYLE_HUE = 220 # Default: 220 HTML_COLORSTYLE_SAT = 255 # Default: 100 HTML_COLORSTYLE_GAMMA = 100 # Default: 80 @@ -572,7 +569,7 @@ CALL_GRAPH = NO CALLER_GRAPH = NO GRAPHICAL_HIERARCHY = NO # TODO: Default: YES DIRECTORY_GRAPH = NO # Default: YES -DOT_IMAGE_FORMAT = svg +DOT_IMAGE_FORMAT = $(DOT_IMAGE_FORMAT) INTERACTIVE_SVG = NO DOT_PATH = DOTFILE_DIRS = diff --git a/docs/doxygen/custom_header_simple.html b/docs/doxygen/custom_header_simple.html new file mode 100644 index 0000000000..a44d712be1 --- /dev/null +++ b/docs/doxygen/custom_header_simple.html @@ -0,0 +1,45 @@ + + + + + +$projectname: $title +$title + + + +$treeview +$search +$mathjax + +$extrastylesheet + + +
+
+ + +
+ + + + + + + + + + + + + + +
+ Version: $projectnumber + $searchbox
+
+ diff --git a/docs/doxygen/regen.bat b/docs/doxygen/regen.bat index 916502608c..6899566107 100644 --- a/docs/doxygen/regen.bat +++ b/docs/doxygen/regen.bat @@ -1,8 +1,7 @@ @echo off -REM This bash script regenerates the HTML doxygen version of the -REM wxWidgets manual and adjusts the doxygen log to make it more -REM readable. +REM This batch script is used to regenerate the CHM doxygen version of the +REM wxWidgets manual. where /q doxygen if %ERRORLEVEL% neq 0 ( @@ -23,6 +22,10 @@ pushd ..\.. set WXWIDGETS=%CD% popd +REM SVG is not supported by CHM and we can't/don't need to use custom JS with it. +set HTML_HEADER=custom_header_simple.html +set DOT_IMAGE_FORMAT=png + REM Defaults for settings controlled by this script set GENERATE_DOCSET=NO set GENERATE_HTML=NO diff --git a/docs/doxygen/regen.sh b/docs/doxygen/regen.sh index 6adfe2e3ab..ad9f6e4f98 100755 --- a/docs/doxygen/regen.sh +++ b/docs/doxygen/regen.sh @@ -62,6 +62,14 @@ mkdir -p $WX_HTML_OUTPUT_DIR/generic # custom aliases cp images/generic/*png $WX_HTML_OUTPUT_DIR/generic +# These values are always used here, the corresponding options only exist in +# order to allow not using them when generating CHM in regen.bat. +export DOT_IMAGE_FORMAT='svg' +export HTML_HEADER='custom_header.html' +export CUSTOM_THEME_CSS='doxygen-awesome-css/doxygen-awesome.css' +export CUSTOM_THEME_JS1='doxygen-awesome-css/doxygen-awesome-darkmode-toggle.js' +export CUSTOM_THEME_JS2='doxygen-awesome-css/doxygen-awesome-fragment-copy-button.js' + # Defaults for settings controlled by this script export GENERATE_DOCSET="NO" export GENERATE_HTML="NO"