-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_doc
More file actions
executable file
·58 lines (52 loc) · 1.53 KB
/
create_doc
File metadata and controls
executable file
·58 lines (52 loc) · 1.53 KB
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
#!/usr/bin/env bash
set -e
function create_pdf() {
(
cd docs || exit 1
make latexpdf || exit 1
make latexpdf || exit 1
cp -p _build/latex/detloclcheck.pdf ../manual_detloclcheck.pdf || exit 1
) || exit 1
}
function create_html() {
skipcp=$1
if [ "$skipcp" != "true" ]; then
sed '/^---$/,/^---$/d' README.md > docs/README.md
cp -p LICENSE.md LICENSE.LESSER.md checkerboard_example_image.png foo_visualized.png docs/
fi
if [ -f docs/test_coverage_report/index.html ]; then
rm docs/test_coverage_report/index.html
fi
if [ -d coverage_report ]; then
cp -p coverage_report/index.html docs/test_coverage_report/
fi
(
cd docs || exit 1
make html || exit 1
) || exit 1
outputdir="manual_detloclcheck"
if [ ! -d $outputdir ]; then
mkdir $outputdir
fi
rsync --delete-after --archive --one-file-system --links --hard-links --sparse --checksum docs/_build/html/ $outputdir/
if [ -d coverage_report ]; then
rsync -a -r --delete --exclude=index.rst --exclude=index.html coverage_report/ $outputdir/test_coverage_report/
fi
}
cp -p README.md LICENSE.md LICENSE.LESSER.md checkerboard_example_image.png foo_visualized.png docs/ || exit $?
if [ $# -eq 0 ]; then
# build all documentation formats in parallel
create_pdf &
pid1=$!
create_html skipcp &
pid2=$!
wait $pid1 $pid2 && echo -e "\n+-------+\n| ready |\n+-------+"
else
if [ "$1" = "html" ]; then
create_html
fi
if [ "$1" = "pdf" ]; then
create_pdf
fi
echo -e "\n+-------+\n| ready |\n+-------+"
fi