summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorAndres Mejia <amejia004@gmail.com>2012-02-01 14:29:19 -0500
committerAndres Mejia <amejia004@gmail.com>2012-02-01 14:29:19 -0500
commit0dc05246bab6ac3aff28cd05edf061527a7cca3f (patch)
tree235b2d93dd7739c8ed85bd04db54a1e029bb81cb /doc
parent8a1374336749be94b596bc47a44c090364f05b57 (diff)
downloadlibarchive-0dc05246bab6ac3aff28cd05edf061527a7cca3f.tar.gz
Use html2wiki to generate mediawiki pages from generated html pages.
Set use of html2wiki as optional. SVN-Revision: 4219
Diffstat (limited to 'doc')
-rwxr-xr-xdoc/update.sh38
1 files changed, 35 insertions, 3 deletions
diff --git a/doc/update.sh b/doc/update.sh
index df000373..d2100bd6 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)