forked from chilek/lms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docgen.sh
executable file
·56 lines (45 loc) · 920 Bytes
/
docgen.sh
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
#
# Script generates documentation in different formats
# (html, txt) from source sgml files
#
# Programs required:
# -sgml-tools
# -openjade
# -lynx
cd ../doc/sgml
generate_html()
{
jade -t sgml -d lms.dsl index.sgml
if [ $? -ne 0 ]
then exit 1
fi
mv ./*.html ../html/en/
}
generate_txt()
{
jade -t sgml -V nochunks -d lms.dsl index.sgml > ../README.html
if [ $? -ne 0 ]
then exit 1
fi
lynx -dump ../README.html -display_charset=ISO-8859-1 -raw -nolist -dont_wrap_pre > ../README
if [ $? -ne 0 ]
then exit 2
fi
rm ../README.html
}
case "$1" in
'html') ####### sgml -> html #######################
generate_html
;;
'txt') ####### sgml -> text #######################
generate_txt
;;
'all') ####### sgml -> html & txt #################
generate_html
generate_txt
;;
*)
echo -e "$0: Lost option.\nUsage: docgen.sh html|txt|all"
;;
esac