From de4ec8523073a91f4cc36cf49e762600c2023bb5 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 6 Jan 2016 07:40:03 -0600 Subject: [PATCH] Copy annotated versions of .md and .cc files into the page. Also provide links to them at the top. --- doc/doxygen/scripts/make_gallery.pl | 39 ++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/doc/doxygen/scripts/make_gallery.pl b/doc/doxygen/scripts/make_gallery.pl index 7caec1c0ed..d8e54a8c70 100644 --- a/doc/doxygen/scripts/make_gallery.pl +++ b/doc/doxygen/scripts/make_gallery.pl @@ -56,6 +56,10 @@ This program consists of the following files (click to inspect): foreach my $file (@src_files) { print "- $file\n"; + if ($file =~ /.*\.(md|markdown|cc|cpp|cxx|c\+\+|h|hh|hxx)/) + { + print " (see below for an annotated version)\n"; + } } print "\n"; @@ -73,7 +77,7 @@ foreach my $file (@src_files) if (@picture_files) { - print "

Pictures from this code gallery program:

\n"; + print "

Pictures from this code gallery program

\n"; print "

\n"; print "\n"; @@ -99,5 +103,38 @@ if (@picture_files) } +# Then go through the list of files again and see which ones we can +# annotate and copy into the current document +foreach my $file (@src_files) +{ + # just copy markdown files as-is, but make sure we update links + if ($file =~ /.*\.(md|markdown)/) + { + print "\n"; + print "

Annotated version of $file

\n"; + + open MD, "<$gallery_dir/$file"; + while ($line = ) { + # update markdown links of the form "[text](./filename)" + $line =~ s/(\[.*\])\(.\//\1\(..\/code-gallery\/$gallery\//g; + print "$line"; + } + + print "\n\n"; + } + + # annotate source files + if ($file =~ /.*\.(cc|cpp|cxx|c\+\+|h|hh|hxx)/) + { + print "\n"; + print "

Annotated version of $file

\n"; + + system $^X, "$cmake_source_dir/doc/doxygen/scripts/program2doxygen", "$gallery_dir/$file"; + + print "\n\n"; + } +} + + # end the doxygen input file print "*/\n"; -- 2.39.5