From afb5ba0c28af59cb421d7ee16c7d793bc3dda35c Mon Sep 17 00:00:00 2001 From: wolf Date: Tue, 24 Jan 2006 20:53:25 +0000 Subject: [PATCH] Also show a table of content for the plain listing, so that one can jump right to the correct place in the program. git-svn-id: https://svn.dealii.org/trunk@12147 0785d39b-7218-0410-832d-ea1e28bc413d --- .../tutorial/chapter-2.step-by-step/Makefile | 4 +++- .../tutorial/chapter-2.step-by-step/head.html | 11 ++++++----- .../chapter-2.step-by-step/program2plain | 19 ++++++++++++++++++- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/Makefile b/deal.II/doc/tutorial/chapter-2.step-by-step/Makefile index 1d7bebe9fd..774e276156 100644 --- a/deal.II/doc/tutorial/chapter-2.step-by-step/Makefile +++ b/deal.II/doc/tutorial/chapter-2.step-by-step/Makefile @@ -17,11 +17,13 @@ $(example-htmls): @TOC=`cat $D/examples/$(@:.html=)/$(@:.html=.cc) \ | $(PERL) program2toc \ | $(PERL) -pi -e 's/\"/\\\"/g;'` ; \ + plainTOC=`echo $$TOC | $(PERL) -pi -e 's/href=.../href=\\\"\#plain-/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;" \ + | $(PERL) -pi -e "s!commentedTOC!$$TOC!g;" \ + | $(PERL) -pi -e "s!plainTOC!$$plainTOC!g;" \ > $@ @cat $(@:.html=.data/intro.html) >> $@ @cat $D/examples/$(@:.html=)/$(@:.html=.cc) \ diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/head.html b/deal.II/doc/tutorial/chapter-2.step-by-step/head.html index ba932f060d..b4a6757cb3 100644 --- a/deal.II/doc/tutorial/chapter-2.step-by-step/head.html +++ b/deal.II/doc/tutorial/chapter-2.step-by-step/head.html @@ -19,10 +19,11 @@

Overview of step xxx

    -
  1. Introduction -
  2. The commented program -TOC -
  3. Results -
  4. The plain program +
  5. Introduction +
  6. The commented program +commentedTOC +
  7. Results +
  8. The plain program +plainTOC
diff --git a/deal.II/doc/tutorial/chapter-2.step-by-step/program2plain b/deal.II/doc/tutorial/chapter-2.step-by-step/program2plain index 52819ff606..f6aded2746 100644 --- a/deal.II/doc/tutorial/chapter-2.step-by-step/program2plain +++ b/deal.II/doc/tutorial/chapter-2.step-by-step/program2plain @@ -32,7 +32,24 @@ do { s/\t/ /g; print " $_"; - } + } else { + # second, replace section headers, and generate addressable + # anchor + if ( /\@sect/ ) { + # replace quotation marks by the appropriate HTML quotation marks + s!``!“!g; + s!''!”!g; + + # replace double dashes in comments by — + s!--!—!g; + + m!\@sect(\d)\{(.*)\}\s*$!; + $sect_name = $2; + $sect_name =~ s/\s/_/g; + $_ = "\n"; + print; + } + } } while (<>); print "\n

\n\n"; -- 2.39.5