]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Allow section headers higher than 4.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 9 Feb 2006 19:27:12 +0000 (19:27 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 9 Feb 2006 19:27:12 +0000 (19:27 +0000)
git-svn-id: https://svn.dealii.org/trunk@12284 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/doc/tutorial/chapter-2.step-by-step/program2toc

index 41dcec362f4a81b4d36103209cc4ce78e3307e01..99bee597bb8fc87fdc11782091d95b8f25916909 100644 (file)
@@ -13,18 +13,22 @@ while (<>) {
         # replace double dashes in comments by &mdash;
        $text =~ s!--!&mdash;!g;
 
-       # only allow header levels 3 and 4, since higher ones are
+       # only allow header levels 3 through 6, since higher ones are
        # reserved for top-level document headers
-       if (! ($newlevel =~ /[34]/)) {
-           print STDERR "Only header levels 3 and 4 are allowed.\n";
+       if (! ($newlevel =~ /[3456]/)) {
+           print STDERR "Only header levels 3 through 6 are allowed.\n";
            print STDERR "You had $newlevel.\n";
            die;
        }
 
        if ($newlevel > $level) {
-           print "      <ul>\n";
+           for ($i=$level; $i<$newlevel; ++$i) {
+               print "      <ul>\n";
+            }
        } elsif ($newlevel < $level) {
-           print "      </ul>\n";
+           for ($i=$newlevel; $i<$level; ++$i) {
+               print "      </ul>\n";
+            }
        }
 
        $reftext = $text;
@@ -35,7 +39,6 @@ while (<>) {
     } 
 }
 
-if ( $level == 4) {
+for (; $level>=3; --$level) {
     print "      </ul>\n";
 }
-print "    </ul>\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.