forked from ssinyagin/gerty
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmkhtml.sh
More file actions
33 lines (21 loc) · 647 Bytes
/
Copy pathmkhtml.sh
File metadata and controls
33 lines (21 loc) · 647 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# This script requires "pandoc" utility, which is usually available as a
# package for major OSes
HTMLDIR=$1
if [ x$HTMLDIR = x ]; then
echo Usage: $0 DIR 1>&2
exit 1
fi
if [ ! -d $HTMLDIR ]; then
echo No such directory: $HTMLDIR 1>&2
exit 1
fi
IDX=$HTMLDIR/index.html
echo '<HTML><TITLE>Gerty software documentation</TITLE>' >$IDX
echo '<BODY><OL>' >>$IDX
for f in `dirname $0`/doc/*.markdown; do
src=`basename $f`
dst=`echo $src | sed -e 's,\.markdown,.html,'`
pandoc -s -f markdown -t html -o $HTMLDIR/$dst $f
echo '<LI><A HREF="'$dst'">'$dst'</A></LI>' >>$IDX
done
echo '</OL></BODY></HTML>' >>$IDX