From: Wolfgang Bangerth Date: Thu, 3 Mar 2022 15:35:05 +0000 (-0700) Subject: Annotate more code gallery source files. X-Git-Tag: v9.4.0-rc1~370^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f6ecae955ffecf8e02c8514455a0c9ddab19ccdd;p=dealii.git Annotate more code gallery source files. --- diff --git a/doc/doxygen/scripts/make_gallery.pl b/doc/doxygen/scripts/make_gallery.pl index 14c2d3b890..2eb1e93cb0 100644 --- a/doc/doxygen/scripts/make_gallery.pl +++ b/doc/doxygen/scripts/make_gallery.pl @@ -73,7 +73,7 @@ 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)/) + if ($file =~ /.*\.(md|markdown|cc|cpp|cxx|c\+\+|h|hh|hxx|py|sh|m)$/) { print " (annotated version)\n"; } @@ -128,7 +128,7 @@ foreach my $file (@src_files) # 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)/) + if ($file =~ /.*\.(md|markdown)$/) { print "\n"; print "

Annotated version of $file

\n"; @@ -157,8 +157,8 @@ foreach my $file (@src_files) print "\n\n"; } - # annotate source files - if ($file =~ /.*\.(cc|cpp|cxx|c\+\+|h|hh|hxx)/) + # annotate C++ source files + elsif ($file =~ /.*\.(cc|cpp|cxx|c\+\+|h|hh|hxx)$/) { print "\n"; print "

Annotated version of $file

\n"; @@ -167,6 +167,29 @@ foreach my $file (@src_files) print "\n\n"; } + + # let doxygen mark up files in other supported languages (and in + # some unsupported ones like .m Matlab files, which doxygen then + # simply copies into the output unparsed and without markup): + elsif ($file =~ /.*\.(py|sh|m)$/) + { + $extension = $1; + + print "\n"; + print "

Annotated version of $file

\n"; + + + print "\@code{.$extension}\n"; + open MD, "<$gallery_dir/$file"; + my $incode = 0; + while ($line = ) + { + print "$line"; + } + print "\@endcode\n"; + + print "\n\n"; + } }