]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Extend the capabilities of the program2html processor and accompanied machinery to...
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 2 Nov 2001 08:27:56 +0000 (08:27 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 2 Nov 2001 08:27:56 +0000 (08:27 +0000)
git-svn-id: https://svn.dealii.org/trunk@5179 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/doc/tutorial/chapter-2.step-by-step/Makefile
deal.II/doc/tutorial/chapter-2.step-by-step/head.html
deal.II/doc/tutorial/chapter-2.step-by-step/program2html
deal.II/examples/step-7/step-7.cc
deal.II/examples/step-9/step-9.cc

index ed9b7ebf02c545188eff8bfff442a90583326681..4d386c386f869e9d56a547186347625ed8762936 100644 (file)
@@ -14,10 +14,16 @@ all: $(example-htmls)
 
 $(example-htmls):
        @echo ================== Assembling $@
-       @cat head.html \
+       @TOC=`cat $D/examples/$(@:.html=)/$(@:.html=.cc) \
+         | grep "@sect" \
+         | perl -pi -e 's/.*\{(.*)\}.*/\1/; $$n=$$1; $$nn=$$1; \
+           $$nn=~s/\s/_/g; $$_="<li><a href=\"#$$nn\">$$n</a></li>\n";' \
+         | perl -pi -e 's/\"/\\\"/g;'` ; \
+        cat head.html \
          | perl -pi -e '$$step="$@";                     \
                          $$step=~s/step-(\d+).html/$$1/g; \
                          s/step xxx/step $$step/g;'       \
+         | perl -pi -e "s!TOC!$$TOC!g;" \
          > $@
        @cat $(@:.html=.data/intro.html) >> $@
        @cat $D/examples/$(@:.html=)/$(@:.html=.cc) \
index 57bb61426c0155fc61f83a2b750c035e53e4aad2..6e5cab2015a4b9dbe0b31bb178447863b593a57b 100644 (file)
@@ -21,6 +21,9 @@
 <ol>
   <li> <a href="#Intro">Introduction</a>
   <li> <a href="#CommProg">The commented program</a>
+       <ul>
+       TOC
+       </ul>
   <li> <a href="#Results">Results</a>
   <li> <a href="#PlainProg">The plain program</a>
 </ol>
index 6e3c359e2c7e68c40b1d4147a1d0527581b6ea20..41c836f8b390a8a87478524b5cf033eaa60ae87f 100644 (file)
@@ -44,8 +44,21 @@ while (<>) {
     
     if ($state == $comment_mode) 
     {
-       m!\s*//\s*(.*)!;
-       print $1, "\n";
+       # in comment mode: first skip leading whitespace and
+       # comment // signs
+       s!\s*//\s*(.*)!$1!;
+
+       # second, replace section headers, and generate addressable
+       # anchor
+       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
index 0f1ea668744be46329798038dcd525b5ceb8e413..10e939827c05b554cd76c753f5fb8893a0b6bc35 100644 (file)
 #include <fstream>
 
 
-
-                                // Since we want to compare the
-                                // exactly known continuous solution
-                                // to the computed one, we need a
-                                // function object which represents
-                                // the continuous solution. On the
-                                // other hand, we need the right hand
-                                // side function, and that one of
-                                // course shares some characteristics
-                                // with the solution. In order to
-                                // reduce dependencies which arise if
-                                // we have to change something in
-                                // both classes at the same time, we
+                                // @sect3{Equation data}
+
+                                // Before implementing the classes
+                                // that actually solve something, we
+                                // first declare and define some
+                                // function classes that represent
+                                // right hand side and solution
+                                // classes. Since we want to compare
+                                // the exactly known continuous
+                                // solution to the computed one, we
+                                // need a function object which
+                                // represents the continuous
+                                // solution. On the other hand, we
+                                // need the right hand side function,
+                                // and that one of course shares some
+                                // characteristics with the
+                                // solution. In order to reduce
+                                // dependencies which arise if we
+                                // have to change something in both
+                                // classes at the same time, we
                                 // exclude the common characteristics
                                 // of both functions into a base
                                 // class.
@@ -331,6 +338,7 @@ double RightHandSide<dim>::value (const Point<dim>   &p,
 };
 
 
+                                // @sect3{The Laplace solver class}
 
                                 // Then we need the class that does
                                 // all the work. It is mostly the
@@ -1732,6 +1740,7 @@ void LaplaceProblem<dim>::run ()
     }
 };
 
+                                // @sect3{Main function}
 
                                 // The main function is mostly as
                                 // before. The only difference is
index e2f811f86edff08bbe4e39dac3ad1aefccf3c955..c735d66bcc788a41164bd0bc161a413ba6db515a 100644 (file)
@@ -77,6 +77,7 @@
 #  define      M_PI            3.14159265358979323846
 #endif
 
+                                // @sect3{AdvectionProblem class declaration}
 
                                 // Following we declare the main
                                 // class of this program. It is very
@@ -183,6 +184,7 @@ class AdvectionProblem
 
 
 
+                                // @sect3{Equation data declaration}
 
                                 // Next we declare a class that
                                 // describes the advection
@@ -494,6 +496,7 @@ BoundaryValues<dim>::value_list (const std::vector<Point<dim> > &points,
 
 
 
+                                // @sect3{GradientEstimation class declaration}
 
                                 // Now, finally, here comes the class
                                 // that will compute the difference
@@ -620,7 +623,7 @@ class GradientEstimation
 
 
 
-
+                                // @sect3{AdvectionProblem class implementation}
 
 
                                 // Now for the implementation of the
@@ -1410,6 +1413,7 @@ void AdvectionProblem<dim>::run ()
 
 
 
+                                // @sect3{GradientEstimation class implementation}
 
                                 // Now for the implementation of the
                                 // ``GradientEstimation'' class. The
@@ -2030,6 +2034,8 @@ GradientEstimation::estimate_interval (const DoFHandler<dim> &dof_handler,
 };
 
 
+                                // @sect3{Main function}
+
                                 // The ``main'' function is exactly
                                 // like in previous examples, with
                                 // the only difference in the name of

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.