-
Notifications
You must be signed in to change notification settings - Fork 0
/
docs-generate.sh
executable file
·59 lines (49 loc) · 1.13 KB
/
docs-generate.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
#!/bin/bash
# chmod +x docs-generate.sh
# ./docs-generate.sh
function logging() {
echo -e "\033[0;32m$1\033[0m"
}
function warnings() {
echo -e "\033[31m$1\033[0m"
}
function whereIam() {
echo -e "@ \033[07m`pwd`\033[0m"
}
# SCRIPT_DIR=$(cd $(dirname $0); pwd)
SRC_DIRNAME="src"
DOC_DIRNAME="docs"
MODULE_DIRNAME="{{ MODULE_NAME }}"
REBUILD_DIRNAMES=(
"${DOC_DIRNAME}"
"src/_build/plot_directive"
)
CREATED_DIRNAME="_build/html"
HERE=$(cd $(dirname $0);pwd)
logging "cd $HERE"
cd $HERE
whereIam
for DIRNAME in ${REBUILD_DIRNAMES[@]}
do
echo "${DIRNAME}"
if [ -d $DIRNAME ]; then
warnings "Delete old $DIRNAME directory."
rm -rf $DIRNAME
fi
done
logging "$ sphinx-apidoc -f -e -o $SRC_DIRNAME $MODULE_DIRNAME"
poetry run sphinx-apidoc -f -e -o $SRC_DIRNAME $MODULE_DIRNAME
logging "cd $SRC_DIRNAME"
cd $SRC_DIRNAME
whereIam
logging "make html"
make html
logging "mv $CREATED_DIRNAME ../$DOC_DIRNAME"
mv $CREATED_DIRNAME ../$DOC_DIRNAME
cd $HERE
whereIam
for IMG in background.png not-found.png
do
logging "cp $SRC_DIRNAME/_images/$IMG $DOC_DIRNAME/_images/$IMG"
cp $SRC_DIRNAME/_images/$IMG $DOC_DIRNAME/_images/$IMG
done