#!/bin/sh cd $(dirname $0) || exit cp -a $0 $0.txt file=${1%.} [ ! -z "$file" ] && list="$file.rst" || list=*.rst for a in $list do [ -r "$a" ] || continue html=${a%%rst}html cp template.html $html perl -pe "s#$html\"#$html\" class=\"active\"#" -i $html rst2html --no-toc-backlinks $a 2>/dev/null | perl -pe 's/<\/h1>/<\/span><\/span><\/span><\/h1>/g ; s/

/

/g ; s/// ; s/Jeremy/Jérémy/' | perl -ne '$print = 1 if /
/; print if $print' | grep -v '^$' >> $html printf "
\n\n\n" >> $html # vim $html <<-eof # :set ts=4 # :set expandtab # =G # :wq! # eof done for type in tgz deb do url_latest=$(grep -Eo "http://downloads.sourceforge.net/sqlsus/sqlsus-[a-z0-9\.]+.$type" download.rst) echo "Redirecting to sourceforge..." > get-latest-$type.html done sed 's//
/' -i download.html