]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Take over the changes 1.7->1.9 introducing the ability to have subsections in example...
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 21 Nov 2001 10:22:15 +0000 (10:22 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 21 Nov 2001 10:22:15 +0000 (10:22 +0000)
git-svn-id: https://svn.dealii.org/branches/Branch-3-2@5229 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 6e3c359e2c7e68c40b1d4147a1d0527581b6ea20..0b7cc35b5ea623402e613ea13121ce00ba22903b 100644 (file)
@@ -44,8 +44,23 @@ while (<>) {
     
     if ($state == $comment_mode) 
     {
-       m!\s*//\s*(.*)!;
-       print $1, "\n";
+       # in comment mode: first skip leading whitespace and
+       # comment // signs
+       s!\s*//\s*(.*)\n!$1!;
+
+       # second, replace section headers, and generate addressable
+       # anchor
+       if ( /\@sect/ ) {
+          s!\@sect(\d)\{(.*)\}\s*$!<h$1>$2</h$1>!g;
+          $sect_name = $2;
+          $sect_name =~ s/\s/_/g;
+          $_ = "\n<a name=\"$sect_name\"></a>" . $_;
+       }
+
+       # finally print this line
+       print $_, "\n";
+
+       # if empty line, introduce paragraph break
        print "</p>\n\n<p>" if  $1 =~ m!^\s*$!;
     }
     else

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.