#!/bin/sh cd $(dirname -- $0) if [ -z "$1" ]; then echo "Syntax: $0 " exit 1 fi BUILDDIR="$1" mkdir -p $BUILDDIR/htdocs if ! which pandoc; then echo "Please install pandoc to build the documentation files." > $BUILDDIR/htdocs/index.html exit 0 fi if ! which sphinx-build; then echo "Please install sphinx-build to build the documentation files." > $BUILDDIR/htdocs/index.html exit 0 fi BUILDDIR="$1" echo "Build dir: $BUILDDIR" rm -f index.rst cat > index.rst <> index.rst for file in $files; do cat $file echo done | sed 's/<\/a>//' | pandoc -f markdown_phpextra -t rst > chapter-$chapter.rst done sphinx-build -b html -d $BUILDDIR/doctrees . $BUILDDIR/htdocs