]> https://gitweb.dealii.org/ - dealii.git/commitdiff
add @dealiiTutorialDOI{} macro for tutorial programs 4145/head
authorTimo Heister <timo.heister@gmail.com>
Thu, 30 Mar 2017 15:11:01 +0000 (11:11 -0400)
committerTimo Heister <timo.heister@gmail.com>
Sun, 2 Apr 2017 19:27:27 +0000 (15:27 -0400)
doc/doxygen/scripts/filter
examples/step-56/doc/intro.dox

index a8b75467e8ad9edc358c84790614d6fd4b505e9b..6ecf2a2891c0f99b5156d34e457dddaea9fddefa 100755 (executable)
@@ -75,7 +75,29 @@ while (<>)
     # "file :", which doxygen doesn't recognize:
     s#file:[ \t]*$#file :#g;
 
-
+    # handle tutorial DOIs of the form @dealiiTutorialDOI{link,imglink}
+    # and @dealiiTutorialDOI{link}
+    if (m/(\@dealiiTutorialDOI\{([^\}]+)\})/)
+    {
+       @args = split(',', $2, 2);
+       $doi = @args[0];
+       $url = "https://doi.org/" . $doi;
+       $imgurl = @args[1] || '';
+       $text = "\@note If you use this program as a basis for your own work, please consider citing it in your list of references. The initial version of this work was contributed to the deal.II project by the authors listed in the following citation: ";
+       # Note: We need to wrap the html in @htmlonly @endhtmlonly because doxygen
+       # will remove the embedded img tag completely otherwise. Don't ask me why.
+       $text = $text . "\@htmlonly <a href=\"$url\">";
+       if (length($imgurl) > 0)
+       {
+           $text = $text . "<img src=\"$imgurl\" alt=\"$doi\"/>";
+       }
+       else
+       {
+           $text = $text . "$doi";
+       }
+       $text = $text . "</a> \@endhtmlonly";
+       s/(\@dealiiTutorialDOI\{([^\}]+)\})/$text/;
+    }
 
     # Handle commands such as @dealiiVideoLecture{20.5,33} by expanding it
     # into a note with some text
index 39eb323ff89c3807cd95a7ae702426c796520901..41b57dd210fed8f6a800eb147d1c8fdbbb18c32c 100644 (file)
@@ -11,6 +11,8 @@ the programme Melt in the Mantle where work on this tutorial was
 undertaken. This work was supported by EPSRC grant no EP/K032208/1.
 </i>
 
+@dealiiTutorialDOI{10.5281/zenodo.400995,https://zenodo.org/badge/DOI/10.5281/zenodo.400995.svg}
+
 <a name="Intro"></a> 
 <h1>Introduction</h1>
 

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.