From: Wolfgang Bangerth Date: Wed, 6 Jan 2016 16:00:56 +0000 (-0600) Subject: Deal with ```...``` markdown commands. X-Git-Tag: v8.4.0-rc2~110^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c96dd3851215557c61d6e17f0f48a734f261f090;p=dealii.git Deal with ```...``` markdown commands. doxygen doesn't appear to understand them, so replace them by the doxygen equivalent. --- diff --git a/doc/doxygen/scripts/make_gallery.pl b/doc/doxygen/scripts/make_gallery.pl index ecda2c8609..245bff9025 100644 --- a/doc/doxygen/scripts/make_gallery.pl +++ b/doc/doxygen/scripts/make_gallery.pl @@ -114,13 +114,30 @@ if (@picture_files) foreach my $file (@src_files) { # just copy markdown files as-is, but make sure we update links + # that may be inlined. doxygen doesn't seem to understand the + # ```...``` form of offset commands, so keep track of that as + # well if ($file =~ /.*\.(md|markdown)/) { print "\n"; print "

Annotated version of $file

\n"; open MD, "<$gallery_dir/$file"; - while ($line = ) { + my $incode = 0; + while ($line = ) + { + # replace ``` markdown commands by doxygen equivalents + while ($line =~ m/```/) + { + if ($incode == 0) { + $line =~ s/```/\@code{.sh}/; + $incode = 1; + } else { + $line =~ s/```/\@endcode/; + $incode = 0; + } + } + # update markdown links of the form "[text](./filename)" $line =~ s/(\[.*\])\(.\//\1\(..\/code-gallery\/$gallery\//g; print "$line";