#!/usr/bin/perl -p

# make sure we can just write $...$ for formulas.
s/\$/\@f\$/g;

# however, undo that change if the dollar sign was escaped with a backslash
s/\\\@f\$/\$/g;

# We don't let doxygen put everything into a namespace
# dealii. consequently, doxygen can't link references that contain an
# explicit dealii:: qualification. remove it and replace it by the
# global scope
#
# Now, as of doxygen 1.5, this still produces the wrong result, but
# that's not our fault. This is reported here:
#    http://bugzilla.gnome.org/show_bug.cgi?id=365053
s/(::)?dealii::/::/g;

s#(static dealii::ExceptionBase\&)#\n//\! \@ingroup Exceptions\n \1#g;

# doxygen version 1.7.1 and later have the habit of thinking that
# everything that starts with "file:" is the beginning of a link,
# but we occasionally use this in our tutorials in the form
# "...this functionality is declared in the following header file:",
# where it leads to a non-functional link. We can avoid the problem
# by replacing a "file:" at the end of a line with the text
# "file :", which doxygen doesn't recognize:
s#file:[ \t]*$#file :#g;