]> https://gitweb.dealii.org/ - dealii.git/commitdiff
doxygen: format exception messages 3067/head
authorTimo Heister <timo.heister@gmail.com>
Mon, 5 Sep 2016 19:40:34 +0000 (15:40 -0400)
committerTimo Heister <timo.heister@gmail.com>
Mon, 5 Sep 2016 20:01:01 +0000 (16:01 -0400)
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

doc/doxygen/CMakeLists.txt
doc/doxygen/custom.js [new file with mode: 0644]
doc/doxygen/options.dox.in
doc/doxygen/scripts/mod_header.pl.in
doc/doxygen/stylesheet.css

index de718fc5a4e7182e88cdda48391b43896b567d6f..0606fdd3c03bfabb23d651eb3b10f2e795bd6c79 100644 (file)
@@ -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 (file)
index 0000000..ed5f067
--- /dev/null
@@ -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,"<br/>");
+       s=s.replace(/"|&lt;&lt;/g,"");
+       s=s.replace(/arg1/g,"<i>arg1</i>");
+       s=s.replace(/arg2/g,"<i>arg2</i>");
+       s=s.replace(/arg3/g,"<i>arg3</i>");
+       s=s.replace(/arg4/g,"<i>arg4</i>");
+       s=s.replace(/arg5/g,"<i>arg5</i>");
+       $(this).html(s);
+    });
+});
index 050858672a82fa13526d59e536e5e2b5dac53f43..11b5e8c71f142ac806b571779ef0583b8adabd25 100644 (file)
@@ -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: <div class='doxygen-generated-exception-message'> \1 </div> "
 
 #---------------------------------------------------------------------------
 # configuration options related to source browsing
index 3630f4b1ba6e0ce512f408e9f33322d01d36f90a..d3c79274e3ad381e6fab8d320a043987fa21f3c6 100644 (file)
@@ -7,6 +7,7 @@ $year += 1900;
 if (m'</head>')
 {
     print '<link rel="SHORTCUT ICON" href="deal.ico"></link>', "\n";
+    print '<script type="text/javascript" src="$relpath^custom.js"></script>', "\n";
     print '<meta name="author" content="The deal.II Authors <authors@dealii.org>"></meta>', "\n";
     print '<meta name="copyright" content="Copyright (C) 1998 - ', $year, ' by the deal.II authors"></meta>', "\n";
     print '<meta name="deal.II-version" content="@DEAL_II_PACKAGE_VERSION@"></meta>', "\n";
index 7002ba8acdf331c31dca3c6f6bfaecef582fb6ae..1562747f8c819618e836144abd32d9c7b815f5b9 100644 (file)
@@ -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%;
+}

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.