-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathgenerateDocumentation.sh
executable file
·74 lines (66 loc) · 1.49 KB
/
generateDocumentation.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
set -o nounset
set -o errexit
PROG="$0"
USER=0
DEV=0
usage()
{
cat <<EOF
Usage: ${PROG} [TYPE]
TYPE may be "user", "dev", or "all" (default: "all").
EOF
}
if (( $# > 1 )); then usage; exit 1; fi
case "${1-all}" in
-h,--help) usage; exit 0 ;;
user) USER=1 ;;
dev) DEV=1 ;;
all) USER=1; DEV=1 ;;
*) usage; exit 1 ;;
esac
if [[ "${DEV}" != 0 ]]
then
doxygen docs/dev/Doxyfile
cp docs/dev/*png Documentation/html/
cd Documentation/latex/
make
cd ../..
mkdir -p manual/dev/html
mv Documentation/html manual/dev/html
mv Documentation/latex/refman.pdf manual/dev/
rm -r Documentation
fi
if [[ "${USER}" != 0 ]]
then
cd docs/user
{
for part in \
intro \
installation \
example \
dataPreparation \
timeline \
interactiveTracking \
batchTracking \
trackingInspector \
trackingCli \
trackingParameters \
parametersSelection \
dataOutput
do
sed -n '3p' "${part}.md"
tail -n '+7' "${part}.md"
echo -e '\n'
done
} | sed 's/title:/#/g' > User_Manual.md
mkdir -p ../../manual/user/html
pandoc User_Manual.md -f markdown --mathjax --toc -t html5 -c css/style.css -s -o user_manual.html
cp -r css ../../manual/user/html
cp -r assets ../../manual/user/html
mv user_manual.html ../../manual/user/html
pandoc ../../manual/user/html/user_manual.html -o ../../manual/user/user_manual.pdf
rm User_Manual.md
cd ../..
tar -czvf manual.tar.gz manual/
fi