From 631683cde904b65c097f97d7c5692615a414fd64 Mon Sep 17 00:00:00 2001 From: Thomas Fetzer <thomas.fetzer@iws.uni-stuttgart.de> Date: Tue, 3 Nov 2015 13:38:05 +0100 Subject: [PATCH] [doxygen,cmake] Sanitize links for doxygen, a cmake macros is necessary for this Add preprocessor deprecations to deprecation list in doxygen --- cmake/modules/CMakeLists.txt | 1 + cmake/modules/DumuxDoxygen.cmake | 9 +++++++++ cmake/modules/DumuxMacros.cmake | 1 + doc/doxygen/CMakeLists.txt | 2 +- doc/doxygen/Doxylocal | 13 ++++++++----- doc/doxygen/sanitizelinks.sh | 12 ++++++++++++ 6 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 cmake/modules/DumuxDoxygen.cmake create mode 100755 doc/doxygen/sanitizelinks.sh diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt index 1ece5a71b7..b5a2fa4729 100644 --- a/cmake/modules/CMakeLists.txt +++ b/cmake/modules/CMakeLists.txt @@ -2,6 +2,7 @@ set(modules AddInputFileLinks.cmake CheckConstexpr.cmake CopyOfDuneSymlinkOrCopy.cmake + DumuxDoxygen.cmake DumuxMacros.cmake DumuxTestMacros.cmake) include(GNUInstallDirs) diff --git a/cmake/modules/DumuxDoxygen.cmake b/cmake/modules/DumuxDoxygen.cmake new file mode 100644 index 0000000000..ae4a0fa9c8 --- /dev/null +++ b/cmake/modules/DumuxDoxygen.cmake @@ -0,0 +1,9 @@ +# add_dumux_doxgen_target +# +# make sure, that the doxygen links to todo list, bibliography, etc. are correct +MACRO (add_dumux_doxygen_target) + add_doxygen_target() + add_custom_command(TARGET doxygen_${ProjectName} + POST_BUILD + COMMAND ${CMAKE_SOURCE_DIR}/doc/doxygen/sanitizelinks.sh) +ENDMACRO (add_dumux_doxygen_target) diff --git a/cmake/modules/DumuxMacros.cmake b/cmake/modules/DumuxMacros.cmake index 2a3dc11f91..c8157f8146 100644 --- a/cmake/modules/DumuxMacros.cmake +++ b/cmake/modules/DumuxMacros.cmake @@ -2,6 +2,7 @@ include(CheckConstexpr) # additional macros include(AddInputFileLinks) +include(DumuxDoxygen) include(DumuxTestMacros) find_package(Gnuplot) diff --git a/doc/doxygen/CMakeLists.txt b/doc/doxygen/CMakeLists.txt index f7b8ea5c99..9f66c1ba47 100644 --- a/doc/doxygen/CMakeLists.txt +++ b/doc/doxygen/CMakeLists.txt @@ -1,2 +1,2 @@ # shortcut for creating the Doxyfile.in and Doxyfile -add_doxygen_target() +add_dumux_doxygen_target() diff --git a/doc/doxygen/Doxylocal b/doc/doxygen/Doxylocal index 6d851cb60f..4b9abcb5d3 100644 --- a/doc/doxygen/Doxylocal +++ b/doc/doxygen/Doxylocal @@ -24,8 +24,11 @@ EXTRA_PACKAGES += amsmath,amssymb,units SEARCHENGINE = YES SERVER_BASED_SEARCH = NO -# disable macro expansion (Otherwise, certain properties will not appear -# in the documentation properly. This should be fixed at some time.) -MACRO_EXPANSION = NO - -CITE_BIB_FILES = @top_srcdir@/doc/handbook/dumux-handbook +# the bibliography file used for the doxygen documentation +CITE_BIB_FILES = @top_srcdir@/doc/handbook/dumux-handbook.bib + +# enable macro expansion only for specified macros +MACRO_EXPANSION = YES +EXPAND_ONLY_PREDEF = YES +PREDEFINED = "DUNE_DEPRECATED:=/** \deprecated */" \ + "DUNE_DEPRECATED_MSG(A):=/** \deprecated A */" diff --git a/doc/doxygen/sanitizelinks.sh b/doc/doxygen/sanitizelinks.sh new file mode 100755 index 0000000000..afdd216f66 --- /dev/null +++ b/doc/doxygen/sanitizelinks.sh @@ -0,0 +1,12 @@ +# sanitizes the links to the given lists, because doxygen somehow links +# to a page with a wrong index +function sanitizelinks { + NEW_FILE=`grep -l "\"title\">$1" html/*html | egrep -o [0-9]+` + OLD_FILE=`awk -v a=$NEW_FILE 'BEGIN {printf("%05d", a-1)}'` + sed -i "s/$OLD_FILE/$NEW_FILE/g" html/*html +} + +sanitizelinks "Todo List" +sanitizelinks "Bug List" +sanitizelinks "Deprecated List" +sanitizelinks "Bibliography" -- GitLab