header() { cat<

 /timm's /charming /python /tricks

EOF if [ -z "$2" ] then cat <$1

Download $1.
Read more on How to be Charming (in Python).


EOF fi } footer() { cat<

This file is part of Timm's charming Python tricks.
© 2014, Tim Menzies: tim.menzies@gmail.com, http://menzies.us.

Timm's charming Python tricks are free software: you can redistribute it and/or modify it under the terms of the GNU Lesser Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Timm's charming Python tricks are distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU Lesser Public License along with Foobar. If not, see http://www.gnu.org/licenses. EOF } mkdir -p ../var/code svn -q add ../var 2> /dev/null svn -q add ../var/code 2> /dev/null if [ -n "$1" ]; then rm -rf ../var/code/* rm -f ../charming.zip fi for i in *.md; do stem="${i%.*}" if [ $i -nt ../var/code/$stem.html ]; then echo ../var/code/$stem.html (header ignore ignore markdown_py $i footer) > ../var/code/$stem.html svn -q add ../var/code/$stem.html 2> /dev/null svn -q propset svn:mime-type text/html ../var/code/$stem.html fi done for i in *.py; do stem="${i%.*}" if [ $i -nt ../var/code/$stem.html ]; then echo ../var/code/$stem.html header $stem.py > /tmp/head footer > /tmp/foot source-highlight -H /tmp/head -F /tmp/foot \ -n -i $stem.py -o ../var/code/$stem.html svn -q add ../var/code/$stem.html 2> /dev/null svn -q propset svn:mime-type text/html ../var/code/$stem.html fi done cd .. zip -Ru charming.zip src/* var/code/* svn -q add charming.zip 2> /dev/null svn -q propset svn:mime-type application/zip charming.zip if [ "$1" == "commit" ]; then svn commit -m stuff fi