summaryrefslogtreecommitdiff
path: root/lib/sbin/ThornDocHTML
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sbin/ThornDocHTML')
-rwxr-xr-xlib/sbin/ThornDocHTML48
1 files changed, 48 insertions, 0 deletions
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."