Commit 8a91f0da authored by Davis King's avatar Davis King

Updated doc generation scripts to include the python files in the

python_examples folder.
parent c9dce70c
...@@ -6,6 +6,11 @@ report_failure () ...@@ -6,6 +6,11 @@ report_failure ()
exit 1 exit 1
} }
htmlify_python_file ()
{
pygmentize -f html -O full,style=vs $1 > $1.html
}
htmlify_cmake () htmlify_cmake ()
{ {
echo "<html><head><title>" > $1.html; echo "<html><head><title>" > $1.html;
...@@ -24,7 +29,17 @@ htmlify_cmake () ...@@ -24,7 +29,17 @@ htmlify_cmake ()
-e "s/{\([^}]*\)}/\{<font color='#BB00BB'>\1<\/font>}/g" \ -e "s/{\([^}]*\)}/\{<font color='#BB00BB'>\1<\/font>}/g" \
$1 >> $1.html; $1 >> $1.html;
echo "</pre></body></html>" >> $1; echo "</pre></body></html>" >> $1.html;
}
htmlify_python()
{
FILES=`\ls $1/*.py`
for i in $FILES
do
htmlify_python_file ${i}
rm ${i}
done
} }
get_short_revision_number() get_short_revision_number()
...@@ -81,12 +96,16 @@ makedocs () ...@@ -81,12 +96,16 @@ makedocs ()
# grab a clean copy of the repository # grab a clean copy of the repository
rm -rf docs/cache rm -rf docs/cache
rm -rf docs/web
rm -rf docs/chm/docs
rm -rf cache.$$ rm -rf cache.$$
hg archive cache.$$ || report_failure hg archive cache.$$ || report_failure
# put the stuff we need into the docs/cache folder # put the stuff we need into the docs/cache folder
mkdir docs/cache mkdir docs/cache
mv cache.$$/dlib docs/cache/ mv cache.$$/dlib docs/cache/
mv cache.$$/examples docs/cache/ mv cache.$$/examples docs/cache/
mv cache.$$/python_examples docs/cache/
htmlify_python docs/cache/python_examples/
mv cache.$$/tools docs/cache/ mv cache.$$/tools docs/cache/
rm -rf cache.$$ rm -rf cache.$$
...@@ -126,6 +145,9 @@ makedocs () ...@@ -126,6 +145,9 @@ makedocs ()
cp docs/cache/examples/CMakeLists.txt docs/web/examples cp docs/cache/examples/CMakeLists.txt docs/web/examples
mkdir docs/chm/docs/examples || report_failure mkdir docs/chm/docs/examples || report_failure
cp docs/cache/examples/CMakeLists.txt docs/chm/docs/examples cp docs/cache/examples/CMakeLists.txt docs/chm/docs/examples
cp docs/cache/python_examples/*.py.html docs/chm/docs/
cp docs/cache/python_examples/*.py.html docs/web/
cp docs/*.gif docs/web cp docs/*.gif docs/web
cp docs/*.gif docs/chm/docs cp docs/*.gif docs/chm/docs
cp -r docs/guipics docs/web cp -r docs/guipics docs/web
...@@ -184,13 +206,13 @@ makedocs () ...@@ -184,13 +206,13 @@ makedocs ()
rm docs/stylesheet.$$.xsl rm docs/stylesheet.$$.xsl
done done
# Delete doc type header stuff
FILES=`find docs/chm docs/web -iname "*.html" -type f` # FILES=`find docs/chm docs/web -iname "*.html" -type f`
for i in $FILES # for i in $FILES
do # do
sed -e '/<!DOCTYPE/d' ${i} > temp.$$; # sed -e '/<!DOCTYPE/d' ${i} > temp.$$;
mv temp.$$ ${i}; # mv temp.$$ ${i};
done # done
echo Generating sitemap echo Generating sitemap
......
...@@ -22,6 +22,7 @@ xsltproc -V > /dev/null || return_error "xsltproc"; ...@@ -22,6 +22,7 @@ xsltproc -V > /dev/null || return_error "xsltproc";
tar --help > /dev/null || return_error "tar"; tar --help > /dev/null || return_error "tar";
zip -h > /dev/null || return_error "zip"; zip -h > /dev/null || return_error "zip";
bzip2 -h &> /dev/null || return_error "bzip2"; bzip2 -h &> /dev/null || return_error "bzip2";
pygmentize -h &> /dev/null || return_error "pygmentize";
echo All needed utilities found echo All needed utilities found
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment