TASKPM/www/generate-html.sh
Manuel Rego Casasnovas 205a3f4b6a www: Folder and script for libreplan.org documentation
New folder with link to different documentation files in the source code. It
also includes a script to generate the HTML files that will be available on-line
at http://libreplan.org

FEA: ItEr76S03Community
2012-01-04 16:24:56 +01:00

51 lines
963 B
Bash
Executable file

#!/bin/bash
FILES="\
AUTHORS \
HACKING \
INSTALL \
NEWS \
README \
TODO \
UPDATE \
howto-create-a-new-report-in-libreplan.rst \
howto-develop-a-use-case-in-libreplan.rst \
howto-start-development-with-eclipse.rst \
libreplan-web-services.rst \
"
TMP=`mktemp`
for file in $FILES
do
output=${file%\.rst}.html
# Backup file
if [ -s $output ]
then
mv $output $output.bak
fi
# Generate HTML
rst2html --link-stylesheet --stylesheet-path=lsr.css $file $output > /dev/null 2>$TMP
# Check errors output
if [ -s $TMP ]
then
# Back to original file if errors
echo "Parsing errors in file \"$file\" keeping old file"
if [ -s $output.bak ]
then
mv $output.bak $output
fi
rm $TMP
else
# Remove backup
if [ -s $output.bak ]
then
rm $output.bak
fi
fi
done
rm $TMP