== Converting Chimera Python Code to HTML ==
The python source code can be converted to appealing HTML using [http://pygments.org/ pygments]. For example:
{{{
#!sh
export CHIMERASRC=/data/src/chimera-svn
export MODULE=StructMeasure
cd ${CHIMERASRC}/libs/${MODULE}
for py in *.py; do
html=$(echo $py | sed s/.py$/.html/)
pygmentize -f html -O full,style=colorful,linenos=1 -o $html $py
done
}}}
To see all the options: {{{pygmentize -L}}}
For a full tree of the Chimera libs, try:
{{{
#!sh
#!/bin/bash
export CHIMERAPYGMENTS=/data/src/chimera-pygments
export CHIMERASRC=/data/src/chimera-svn
export CHIMERALIB=$CHIMERASRC/libs
pyfiles=$(find $CHIMERALIB -name "*.py")
for py in $pyfiles; do
html=$(echo $py | sed -e "s/.py$/.html/" -e "s#${CHIMERALIB}#${CHIMERAPYGMENTS}#g")
echo $html
mkdir -p $(dirname $html)
pygmentize -f html -O full,style=trac,linenos=1 -o $html $py
done
}}}