Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 46ba941862
Fetching contributors…

Cannot retrieve contributors at this time

executable file 66 lines (55 sloc) 1.555 kB
#! /bin/bash
#
# mksite - Upload CZMQ manual to czmq.zeromq.org/manual:
#
# Author: Pieter Hintjens <ph@imatix.com>
# License: public domain
#
# syntax: mksite
#
# Export so child scripts can access these
export UPLOAD=1 # If 0, don't actually upload
export CATEGORY=manual # Category to receive man pages
export WEBSITE=czmq # Wikidot website prefix
# This function uploads a file to wikidot
# Error in upload will cause the script to exit with non-zero status
function do_upload {
./wdput $WEBSITE $CATEGORY $1 $2
if [ $? != 0 ]; then
echo "Error uploading file to wikidot"
exit 1
fi
}
echo "Building docs..."
make --quiet
rm -f *.xml # Makefile does not detect version differences for XML
for FILE in z*.txt; do
./mkman $FILE
make `basename $FILE .txt`.xml
done
echo "Generating XML pages for manual..."
FILES=
for FILE in czmq.txt z*.txt; do
BASE=`basename $FILE .txt`
make --quiet $BASE.xml;
FILES="$FILES $BASE"
done
echo "Generating Wikidot pages..."
for FILE in $FILES; do
perl ./xml2wd.pl $FILE.xml > $FILE.wd
done
if [ $UPLOAD -eq 1 ]; then
echo "Uploading to $CATEGORY..."
# Send table of contents as category:_start
do_upload "_start" "CZMQ Documentation"
# Now send individual man pages
for FILE in $FILES; do
TITLE=`egrep --after-context 1 PAGE_TITLE $FILE.wd | egrep $FILE`
do_upload $FILE $TITLE
done
fi
# Cleanup generated files
rm _start.wd
for FILE in $FILES; do
rm $FILE.wd
done
Jump to Line
Something went wrong with that request. Please try again.