From: Andres Mejia Date: Wed, 1 Feb 2012 19:29:19 +0000 (-0500) Subject: Use html2wiki to generate mediawiki pages from generated html pages. X-Git-Tag: v3.0.4~2^2~140 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0dc05246bab6ac3aff28cd05edf061527a7cca3f;p=thirdparty%2Flibarchive.git Use html2wiki to generate mediawiki pages from generated html pages. Set use of html2wiki as optional. SVN-Revision: 4219 --- diff --git a/doc/update.sh b/doc/update.sh index df000373a..d2100bd6c 100755 --- a/doc/update.sh +++ b/doc/update.sh @@ -5,6 +5,32 @@ # the mdoc man pages stored in each project. # +USAGE="\n\ +Simple script to repopulate the 'doc' tree from\n\ +the mdoc man pages stored in each project.\n\ +\n\ + -h, --help Display this help message\n\ + --mediawiki Use mediawiki markup for wiki pages.\n" + +# Loop that parses options passed to script +while [ "$#" -gt "0" ]; do + case "$1" in + --mediawiki) + if [ -x "$(which html2wiki)" >/dev/null 2>&1 ]; then + USE_MEDIAWIKI=1 + else + echo "html2wiki program not found or is not executable." + exit 1 + fi + shift + ;; + -h|--help|*) + echo -e "${USAGE}" + exit 1 + ;; + esac +done + # Collect list of man pages, relative to my subdirs test -d man || mkdir man cd man @@ -98,8 +124,14 @@ all="all:" for f in $MANPAGES; do outname="`basename $f | awk '{ac=split($0,a,"[_.-]");o="ManPage";for(w=0;w<=ac;++w){o=o toupper(substr(a[w],1,1)) substr(a[w],2)};print o}'`.wiki" echo >> Makefile - echo $outname: ../mdoc2wiki.awk $f >> Makefile - echo " awk -f ../mdoc2wiki.awk < $f > $outname" >> Makefile + if [ -z "$USE_MEDIAWIKI" ]; then + echo $outname: ../mdoc2wiki.awk $f >> Makefile + echo " awk -f ../mdoc2wiki.awk < $f > $outname" >> Makefile + else + inname="../html/$(basename $f).html" + echo $outname: $inname $f >> Makefile + echo " html2wiki --dialect MediaWiki --encoding utf-8 $inname > $outname" >> Makefile + fi all="$all $outname" done echo $all >>Makefile @@ -113,5 +145,5 @@ cd .. (cd pdf && make) # Format all of the manpages to HTML (cd html && make) -# Format all of the manpages to Google Wiki syntax +# Format all of the manpages to wiki syntax (cd wiki && make)