diff options
author | knarf <knarf@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2010-06-03 20:31:49 +0000 |
---|---|---|
committer | knarf <knarf@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2010-06-03 20:31:49 +0000 |
commit | 693dc60c64a0a0e33a0812120f162cb1bfa369ca (patch) | |
tree | cee3d87423706e27de0651c79e6d204ed2357b2e /lib/sbin | |
parent | f01cb2c10a3ab8d41a83a360dc58f95f8508c0a7 (diff) |
Patch from Barry Wardell, thanks:
Enables support for compiling HTML versions of
the Cactus documentation. It adds new build targets:
ReferenceManualHTML
MaintainersGuideHTML
UsersGuideHTML
*-ThornDocHTML
*-ArrangementDocHTML
ThornDocHTML
ArrangementDocHTML
ThornGuideHTML
Which are HTML equivalents of the existing doc targets. This makes use
of the small new scripts lib/sbin/ArrangementDocHTML and
lib/sbin/ThornDocHTML.
This patch also introduces a small new script, lib/sbin/ConvertFigures,
which automates the process of converting figures to the correct format for
htlatex.
Finally, it makes some changes to doc/latex/cactus.sty to improve the
rendering of the HTML. It also modifies the Reference Guide to produce a
more consistent result (any cases of the CCTKFunc macro were updated to
use the newer FunctionDescriptionEntry).
git-svn-id: http://svn.cactuscode.org/flesh/trunk@4621 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin')
-rwxr-xr-x | lib/sbin/ArrangementDoc | 4 | ||||
-rwxr-xr-x | lib/sbin/ArrangementDocHTML | 43 | ||||
-rwxr-xr-x | lib/sbin/ConvertFigures | 22 | ||||
-rwxr-xr-x | lib/sbin/ThornDocHTML | 48 |
4 files changed, 115 insertions, 2 deletions
diff --git a/lib/sbin/ArrangementDoc b/lib/sbin/ArrangementDoc index 701e1a14..d30eb8a4 100755 --- a/lib/sbin/ArrangementDoc +++ b/lib/sbin/ArrangementDoc @@ -14,8 +14,8 @@ for arr in `cd arrangements; echo *`; do if test -e arrangements/$arr/doc/documentation.tex; then echo " Processing arrangement $arr..." - mkdir doc/ArrangementDoc 2> /dev/null - mkdir doc/ArrangementDoc/$arr 2> /dev/null + mkdir -p doc/ArrangementDoc + mkdir -p doc/ArrangementDoc/$arr ( cd doc/ArrangementDoc/$arr rm -f documentation.tex documentation.pdf diff --git a/lib/sbin/ArrangementDocHTML b/lib/sbin/ArrangementDocHTML new file mode 100755 index 00000000..ce2b7e28 --- /dev/null +++ b/lib/sbin/ArrangementDocHTML @@ -0,0 +1,43 @@ +#! /bin/sh +# Create all arrangement documentation (HTML) +# (C) 2003-07-21 Erik Schnetter <schnetter@uni-tuebingen.de> +# (C) 2010-04-21 Barry Wardell <barry.wardell@aei.mpg.de> +# $Header: /cactusdevcvs/Cactus/lib/sbin/ArrangementDoc,v 1.7 2009/11/11 22:32:53 schnetter Exp $ + +echo "Creating arrangement documentation (HTML)..." + +type -P htlatex &>/dev/null || { echo "htlatex not found. Aborting." >&2; exit 1; } + +# Selected arrangement; process all arrangements if this is empty +selection="$1" + +for arr in `cd arrangements; echo *`; do + if test -d arrangements/$arr; then + if test -z "$selection" || test "$arr" == "$selection"; then + if test -e arrangements/$arr/doc/documentation.tex; then + echo " Processing arrangement $arr..." + + mkdir -p doc/HTML/ArrangementDoc/$arr 2> /dev/null + ( + cd doc/HTML/ArrangementDoc/$arr + rm -f documentation.tex documentation.html documentation.css documentation*.png + path=../../../../arrangements/$arr/doc + < $path/documentation.tex sed -e 's+\(\\includegraphics.*\){ *\(.*\) *}+\1{'"$path"'/\2}+g' | + sed -e 's+\(\\input *\)\(.*\)+\1'"$path"'/\2+g' | + sed -e 's+\\usepackage{../../../doc/latex/cactus}+\\usepackage{../../../../doc/latex/cactus}+g' > documentation.tex + + ../../../../lib/sbin/ConvertFigures $path + + { + htlatex documentation "" "" "" -interaction=nonstopmode > LATEX_MESSAGES 2>&1 + } || + echo " ERROR: Could not create documentation (check for latex errors)" + ) + + fi # if arrangement has documentation + fi # if arrangement is enabled + fi +done # for arrangements + +echo " Created arrangement documentation (HTML) in doc/HTML/ArrangementDoc directory." +echo " Done." diff --git a/lib/sbin/ConvertFigures b/lib/sbin/ConvertFigures new file mode 100755 index 00000000..73dadbee --- /dev/null +++ b/lib/sbin/ConvertFigures @@ -0,0 +1,22 @@ +#! /bin/sh + +if [ ! -n "$1" ] +then + figpath="." +else + figpath=$1 +fi + +files=`find ${figpath} -type f -name "*.pdf"` + +if [ -n "${files}" ]; then + echo " Converting figures to postscript" +fi + +for i in $files; do + psfilename=`echo $i | sed s/.pdf$/.ps/` + if [ "$i" != "documentation.pdf" ] && [ ! -e $psfilename ]; then + echo " " `basename $i` " -> " `basename $psfilename` + pdf2ps $i $psfilename + fi +done
\ No newline at end of file diff --git a/lib/sbin/ThornDocHTML b/lib/sbin/ThornDocHTML new file mode 100755 index 00000000..24151b52 --- /dev/null +++ b/lib/sbin/ThornDocHTML @@ -0,0 +1,48 @@ +#! /bin/sh +# Create all thorn documentations +# (C) 2003/05/24 Erik Schnetter <schnetter@uni-tuebingen.de> +# (C) 2010-04-21 Barry Wardell <barry.wardell@aei.mpg.de> +# $Header: /cactusdevcvs/Cactus/lib/sbin/ThornDoc,v 1.5 2009/11/11 22:32:53 schnetter Exp $ + +echo "Creating thorn documentation (HTML)..." + +type -P htlatex &>/dev/null || { echo "htlatex not found. Aborting." >&2; exit 1; } + +# Selected thorn; process all thorns if this is empty +selection="$1" + +for arr in `cd arrangements; echo *`; do + if test -d arrangements/$arr; then + for th in `cd arrangements/$arr; echo *`; do + if test -d arrangements/$arr/$th; then + if test -z "$selection" || test "$th" == "$selection"; then + if test -e arrangements/$arr/$th/doc/documentation.tex; then + echo " Processing thorn $arr/$th..." + + mkdir -p doc/HTML/ThornDoc/$arr/$th 2> /dev/null + ( + cd doc/HTML/ThornDoc/$arr/$th + rm -f documentation.tex documentation.html documentation.css documentation*.png + path=../../../../../arrangements/$arr/$th/doc + < $path/documentation.tex sed -e 's+\(\\includegraphics.*\){ *\(.*\) *}+\1{'"$path"'/\2}+g' | + sed -e 's+\(\\input *\)\(.*\)+\1'"$path"'/\2+g' | + sed -e 's+\\usepackage{../../../../doc/latex/cactus}+\\usepackage{../../../../../doc/latex/cactus}+g' > documentation.tex + + ../../../../../lib/sbin/ConvertFigures $path + + echo " Running htlatex..." + { + htlatex documentation "" "" "" -interaction=nonstopmode < /dev/null > LATEX_MESSAGES 2>&1 + } || + echo " ERROR: Could not create documentation (check for latex errors)" + ) + + fi # if thorn has documentation + fi # if thorn is enabled + fi + done # for thorns + fi +done # for arrangements + +echo " Created thorn documentation in doc/HTML/ThornDoc directory." +echo " Done." |