From c96dd3851215557c61d6e17f0f48a734f261f090 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 6 Jan 2016 10:00:56 -0600 Subject: [PATCH] Deal with ```...``` markdown commands. doxygen doesn't appear to understand them, so replace them by the doxygen equivalent. --- doc/doxygen/scripts/make_gallery.pl | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) 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"; -- 2.39.5