]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Annotate more code gallery source files. 13485/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 3 Mar 2022 15:35:05 +0000 (08:35 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 3 Mar 2022 15:36:30 +0000 (08:36 -0700)
doc/doxygen/scripts/make_gallery.pl

index 14c2d3b890a936560362a65960efb85c814ae454..2eb1e93cb0b6c3a055f2b02077a36a060a3a9c62 100644 (file)
@@ -73,7 +73,7 @@ consists of the following files (click to inspect):
 foreach my $file (@src_files)
 { 
   print "- <a href=\"../code-gallery/$gallery/$file\">$file</a>\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 "  (<a href=\"#ann-$file\">annotated version</a>)\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 "<a name=\"ann-$file\"></a>\n";
         print "<h1>Annotated version of $file</h1>\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 "<a name=\"ann-$file\"></a>\n";
         print "<h1>Annotated version of $file</h1>\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 "<a name=\"ann-$file\"></a>\n";
+        print "<h1>Annotated version of $file</h1>\n";
+
+
+        print "\@code{.$extension}\n";
+        open MD, "<$gallery_dir/$file";
+        my $incode = 0;
+        while ($line = <MD>)
+        {
+            print "$line";
+        }
+        print "\@endcode\n";
+
+        print "\n\n";
+    }
 }
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.