From: Timo Heister Date: Mon, 5 Sep 2016 19:40:34 +0000 (-0400) Subject: doxygen: format exception messages X-Git-Tag: v8.5.0-rc1~705^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3067%2Fhead;p=dealii.git doxygen: format exception messages This creates pretty formatting in the doxygen documentation for the exception texts. We do this by including a javascript function that does a couple of string replacements. It is difficult to do this transformation before generating the documentation as detailed in #2571. Fixes #2571 --- diff --git a/doc/doxygen/CMakeLists.txt b/doc/doxygen/CMakeLists.txt index de718fc5a4..0606fdd3c0 100644 --- a/doc/doxygen/CMakeLists.txt +++ b/doc/doxygen/CMakeLists.txt @@ -214,6 +214,7 @@ INSTALL(FILES INSTALL(FILES ${CMAKE_SOURCE_DIR}/doc/deal.ico + ${CMAKE_SOURCE_DIR}/doc/doxygen/custom.js DESTINATION ${DEAL_II_DOCHTML_RELDIR}/doxygen/deal.II COMPONENT documentation ) diff --git a/doc/doxygen/custom.js b/doc/doxygen/custom.js new file mode 100644 index 0000000000..ed5f067aa6 --- /dev/null +++ b/doc/doxygen/custom.js @@ -0,0 +1,14 @@ +$( document ).ready( function() { + // replace the text inside every div with class 'doxygen-generated-exception-message' to be more readable: + $('.doxygen-generated-exception-message').each(function(i, obj) { + var s = $(this).html(); + s=s.replace(/\\n|std::endl/g,"
"); + s=s.replace(/"|<</g,""); + s=s.replace(/arg1/g,"arg1"); + s=s.replace(/arg2/g,"arg2"); + s=s.replace(/arg3/g,"arg3"); + s=s.replace(/arg4/g,"arg4"); + s=s.replace(/arg5/g,"arg5"); + $(this).html(s); + }); +}); diff --git a/doc/doxygen/options.dox.in b/doc/doxygen/options.dox.in index 050858672a..11b5e8c71f 100644 --- a/doc/doxygen/options.dox.in +++ b/doc/doxygen/options.dox.in @@ -83,7 +83,7 @@ ALIASES += dealiiRequiresUpdateFlags{1}="@note For this function to work properl ALIASES += dealiiOperationIsMultithreaded="@note If deal.II is configured with threads, this operation will run multi-threaded by splitting the work into smaller chunks (assuming there is enough work to make this worthwhile)." -ALIASES += dealiiExceptionMessage{1}="@note The message that will be printed by this exception reads: @code \1 @endcode" +ALIASES += dealiiExceptionMessage{1}="@note The message that will be printed by this exception reads:
\1
" #--------------------------------------------------------------------------- # configuration options related to source browsing diff --git a/doc/doxygen/scripts/mod_header.pl.in b/doc/doxygen/scripts/mod_header.pl.in index 3630f4b1ba..d3c79274e3 100644 --- a/doc/doxygen/scripts/mod_header.pl.in +++ b/doc/doxygen/scripts/mod_header.pl.in @@ -7,6 +7,7 @@ $year += 1900; if (m'') { print '', "\n"; + print '', "\n"; print '', "\n"; print '', "\n"; print '', "\n"; diff --git a/doc/doxygen/stylesheet.css b/doc/doxygen/stylesheet.css index 7002ba8acd..1562747f8c 100644 --- a/doc/doxygen/stylesheet.css +++ b/doc/doxygen/stylesheet.css @@ -19,3 +19,10 @@ div.tutorial { padding: 50px; font-size: 95%; } +div.doxygen-generated-exception-message { + color: black; + border: 1px solid #aaa; + background-color: #f9f9f9; + padding: 5px; + font-size: 95%; +}