]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Deal with ```...``` markdown commands.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 6 Jan 2016 16:00:56 +0000 (10:00 -0600)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 6 Jan 2016 16:01:22 +0000 (10:01 -0600)
doxygen doesn't appear to understand them, so replace them by the
doxygen equivalent.

doc/doxygen/scripts/make_gallery.pl

index ecda2c860947134d77c8d1e2b411fd6262a5e447..245bff90253e1b17bee54bc7bc40e44a0f4d4912 100644 (file)
@@ -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 "<a name=\"ann-$file\"></a>\n";
         print "<h1>Annotated version of $file</h1>\n";
 
         open MD, "<$gallery_dir/$file";
-        while ($line = <MD>) {
+        my $incode = 0;
+        while ($line = <MD>) 
+        {
+            # 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";

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.