From 904ff5812d98b7749d026ca7bbd1d335ede0f675 Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Thu, 30 Mar 2017 11:11:01 -0400 Subject: [PATCH] add @dealiiTutorialDOI{} macro for tutorial programs --- doc/doxygen/scripts/filter | 24 +++++++++++++++++++++++- examples/step-56/doc/intro.dox | 2 ++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/doc/doxygen/scripts/filter b/doc/doxygen/scripts/filter index a8b75467e8..6ecf2a2891 100755 --- a/doc/doxygen/scripts/filter +++ b/doc/doxygen/scripts/filter @@ -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 "; + if (length($imgurl) > 0) + { + $text = $text . "\"$doi\"/"; + } + else + { + $text = $text . "$doi"; + } + $text = $text . " \@endhtmlonly"; + s/(\@dealiiTutorialDOI\{([^\}]+)\})/$text/; + } # Handle commands such as @dealiiVideoLecture{20.5,33} by expanding it # into a note with some text diff --git a/examples/step-56/doc/intro.dox b/examples/step-56/doc/intro.dox index 39eb323ff8..41b57dd210 100644 --- a/examples/step-56/doc/intro.dox +++ b/examples/step-56/doc/intro.dox @@ -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. +@dealiiTutorialDOI{10.5281/zenodo.400995,https://zenodo.org/badge/DOI/10.5281/zenodo.400995.svg} +

Introduction

-- 2.39.5