#!/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/