wiki:ChimeraSrc2html

Version 2 (modified by Darren Weber, 15 years ago) ( diff )

--

Converting Chimera Python Code to HTML

The python source code can be converted to appealing HTML using pygments. For example:

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:

#!/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
Note: See TracWiki for help on using the wiki.