From: kanschat Date: Tue, 21 Sep 2010 20:37:02 +0000 (+0000) Subject: prepare use of doxygen @example X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=984ab1444ba9143eff55d980d7e290f86bb559f7;p=dealii-svn.git prepare use of doxygen @example git-svn-id: https://svn.dealii.org/trunk@22106 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/doc/doxygen/options.dox.in b/deal.II/doc/doxygen/options.dox.in index a18c95e1d3..5bb795b7ce 100644 --- a/deal.II/doc/doxygen/options.dox.in +++ b/deal.II/doc/doxygen/options.dox.in @@ -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 diff --git a/deal.II/doc/doxygen/tutorial/Makefile b/deal.II/doc/doxygen/tutorial/Makefile index a8421caf03..af526e24f7 100644 --- a/deal.II/doc/doxygen/tutorial/Makefile +++ b/deal.II/doc/doxygen/tutorial/Makefile @@ -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 " * " >> $@ + @echo " *

The plain program

" >> $@ + @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 index 0000000000..cc08d1a2f0 --- /dev/null +++ b/deal.II/doc/doxygen/tutorial/program2plain @@ -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; +} +