]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
prepare use of doxygen @example
authorkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 21 Sep 2010 20:37:02 +0000 (20:37 +0000)
committerkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 21 Sep 2010 20:37:02 +0000 (20:37 +0000)
git-svn-id: https://svn.dealii.org/trunk@22106 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/doc/doxygen/options.dox.in
deal.II/doc/doxygen/tutorial/Makefile
deal.II/doc/doxygen/tutorial/program2plain [new file with mode: 0644]

index a18c95e1d3f14e23fd00fbf7db72444277db6b5e..5bb795b7ce1bfedd1d89d58ea42bab30f8b356c7 100644 (file)
@@ -483,7 +483,7 @@ EXCLUDE_PATTERNS       = *.templates.h
 # directories that contain example code fragments that are included (see 
 # the \include command).
 
-EXAMPLE_PATH           = @prefix@/examples/doxygen
+EXAMPLE_PATH           = @prefix@/examples/doxygen @prefix@/doc/doxygen/tutorial/plain
 
 # If the value of the EXAMPLE_PATH tag contains directories, you can use the 
 # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
index a8421caf03e9161dbc5ee5d57783d21b9c5d0c97..af526e24f7ded164e3a3f37a2712c522fa219fd3 100644 (file)
@@ -26,7 +26,7 @@ example-toc        = $(addsuffix _toc.combined,$(gen-example-names))
 # same for intermediate files for doxygen output
 example-dox-prog   = $(addsuffix _prog.dox,$(gen-example-names))
 example-dox-plain  = $(addsuffix _plain.dox,$(gen-example-names))
-
+example-plain      = $(addprefix plain/,$(addsuffix .cc,$(example-names)))
 
 # finally a target for combined Doxygen files
 example-doxygen     = $(addprefix doxygen/,$(addsuffix .h,$(example-names)))
@@ -119,6 +119,9 @@ $(example-dox-prog):
          | $(PERL) program2doxygen \
          > $@
 
+$(example-plain):
+       @echo ================== Making $@
+       @cat $D/examples/$(call get_basename, $(@F))/$(@F) | $(PERL) program2plain >> $@
 
 $(example-dox-plain):
        @echo ================== Making $@
@@ -148,9 +151,15 @@ $(example-doxygen):
        @cat generated/$(call get_basename, $@)_prog.dox >> $@
        @cat $D/examples/$(call get_basename, $@)/doc/results.dox \
                | $(PERL) create_anchors >> $@
-       @cat generated/$(call get_basename, $@)_plain.dox >> $@
+       @echo " */" >> $@
+       @echo " /**" >> $@
+       @echo " * <a name=\"PlainProg\"></a>" >> $@
+       @echo " * <h1> The plain program</h1>" >> $@
+       @echo " * @example " $(call get_basename, $@).cc >> $@
        @echo " */" >> $@
 
+# Previous version of the lines after the last 'create_anchor'
+#      @cat generated/$(call get_basename, $@)_plain.dox >> $@
 
 validate-xrefs:
        @$(PERL) $D/common/scripts/validate-xrefs.pl \
@@ -182,11 +191,12 @@ Makefile.dep: $(shell echo $D/examples/*/*.cc $D/examples/*/doc/*.dox) Makefile
                        generated/$${i}_toc.results \
                        generated/$${i}_toc.prog \
                        generated/$${i}_toc.plain ; \
+               echo plain/$$i.cc : `echo $D/examples/$${i}/*.cc` ; \
                echo doxygen/$$i.h : generated/$${i}_prog.dox generated/$${i}_plain.dox \
                                generated/$${i}_toc.combined \
                                $D/examples/$$i/doc/intro.dox \
                                $D/examples/$$i/doc/results.dox \
-                        ; \
+                               plain/$$i.cc ; \
                echo generated/$${i}_toc.intro : \
                                $D/examples/$$i/doc/intro.dox \
                         ; \
diff --git a/deal.II/doc/doxygen/tutorial/program2plain b/deal.II/doc/doxygen/tutorial/program2plain
new file mode 100644 (file)
index 0000000..cc08d1a
--- /dev/null
@@ -0,0 +1,48 @@
+#---------------------------------------------------------------------------
+#    $Id$
+#    Version: $Name$
+#
+#    Copyright (C) 2010 by the deal.II authors
+#
+#    This file is subject to QPL and may not be  distributed
+#    without copyright and license information. Please refer
+#    to the file deal.II/doc/license.html for the  text  and
+#    further information on this license.
+#
+#---------------------------------------------------------------------------
+
+# Remove all comments from the source file
+
+# The variable tracing whether we are inside a block comment
+
+my $block_comment = 0;
+while (<>) {
+    # Eliminate comment lines
+    next if (m!^\s*//!);
+    if (s!^\s*/\*.*\*/!!g)
+    {
+       print unless m/^\s*$/;
+    }    
+    #Find begin of block comment
+    if (0 && s!/\*.*!!)
+    {
+       $block_comment = 1;
+       # Print unless empty
+       print unless m/^\s*$/;
+       next;
+    }
+    
+    # Find end of block comment
+    if ($block_comment != 0)
+    {
+       if (s!.*\*/!!)
+       {
+           $block_comment = 0;
+            # Print unless empty
+           print unless m/^\s*$/;
+           next;
+       }
+    }
+    print;
+}      
+

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.