-
Notifications
You must be signed in to change notification settings - Fork 0
/
mkdocs.sh
executable file
·58 lines (50 loc) · 979 Bytes
/
mkdocs.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
#!/bin/sh
function robodoc_html ()
{
mkdir -pv docs
robodoc --src . --doc docs --html --multidoc \
--nodesc --sections --tell --toc --index
for f in docs/*.html
do
sed -i -e 's/toc_index.html/index.html/' "$f"
done
mv docs/toc_index.html docs/index.html
}
function robodoc_latex ()
{
robodoc --src . --doc mem_alloc_docs --latex --singledoc \
--sections --tell --toc --index
}
function robodoc_pdf()
{
robodoc_latex
mkdir -p tex
mv mem_alloc_docs.tex tex
cd tex
pdflatex mem_alloc_docs.tex
if [ -f "mem_alloc_docs.pdf" ]
then
mv mem_alloc_docs.pdf ../mem_alloc_docs.pdf
fi
cd ..
rm -rf tex
}
if [ -z "$@" ]
then
formats=html
else
formats="$@"
fi
for var in "$formats"
do
if [ "$var" = "html" ]
then
robodoc_html
elif [ "$var" = "pdf" ]
then
robodoc_pdf
elif [ "$var" = "latex" ]
then
robodoc_latex
fi
done