TASKPM/www/generate-html.sh
Manuel Rego Casasnovas 30e78909bc www: Add new README files for Fedora and openSUSE in libreplan.org
FEA: ItEr76S03Community
2012-03-15 10:11:46 +01:00

53 lines
1,005 B
Bash
Executable file

#!/bin/bash
FILES="\
AUTHORS \
HACKING \
INSTALL \
NEWS \
README \
README.Fedora \
README.openSUSE \
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