htmltmpl-template
-----------------
ianw@ieee.org
A wrapper around htmltmpl to create simple websites.
* Usage Instructions
1) HTML templates live in the "inc" sub-directory
2) Each html file is generated from a template file (.tmpl)
Each of these template files has a corresponding .py file where you
can set variables just for that file. Add them by using 'self.tproc'
3) There is a globals.py file that will be includeded in every html
file. Add variables again by using 'self.tproc'
4) There is an 'install' target in the Makefile -- setup the
OUTPUT_DIR variable in the Makefile and add lines to inventory.txt
(wildcards or anything that will be processed by the shell is OK).
Each line will be passed to cp.
* Subdirectories
So far, things are pretty clean. However, if you want to organise in
subdirectories it isn't. Each subdirectory needs to have it's own
'inc' subdirectory for it's includes. However, if you have say a
global header, you don't want to replicate this. The simple way is to
simply symbolic link the header and footers into this subdirectory
'inc' -- but CVS can't handle symlinks.
To handle this, there is a 'ci' target that will copy the commands to
recreate all symlinks to the .symlinks file. The corresponding target
'co' will recreate the links from this file. Remember CVS won't keep
empty directories, so you might need a dummy file in the 'inc'
directory to fool it if all that is in it is symlinks.
* Recreating the sample site
$ make co
/bin/sh -c "source .symlinks"
$ make
python template.py -v index.tmpl
Processing index.tmpl --> index.html ...
python template.py -v subdir/subdir.tmpl
Processing subdir/subdir.tmpl --> subdir/subdir.html ...
subdir/subdir.py not found, continuing ...
$ make install
mkdir -p html
cp --parents *.html subdir/*.html images/*.jpg html/
$ cd html/
$ ls
images index.html subdir