-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild_docs.sh
executable file
·47 lines (31 loc) · 944 Bytes
/
build_docs.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
#!/bin/bash
keyboard_interrupt() {
exit 1
}
trap keyboard_interrupt SIGINT
VERSION="$(poetry version)"
RELEASE="${VERSION//birdfsd-yolov5/}"
if [[ "$RELEASE" == '' ]]; then
echo 'Missing required positional argument: "release number"!'
echo " For example: '0.1.0', '0.2.1', etc."
exit 1
fi
PROJECT_NAME="BirdFSD-YOLOv5"
PACKAGE_FOLDER_NAME='birdfsd_yolov5'
AUTHOR='Mohammad Alyetama'
python -m pip install -e .
rm -rf docs && mkdir docs
cd docs || exit
sphinx-quickstart --no-sep --project "$PROJECT_NAME" \
--author "$AUTHOR" --release "$RELEASE" --language 'en'
rm conf.py && cp ../conf.example.py conf.py
cd ..
curl "https://openmoji.org/data/color/svg/1F426.svg" \
--output docs/_static/logo.svg
sphinx-apidoc -f -o docs "$PACKAGE_FOLDER_NAME" \
"*_dev.py"
cd docs || exit
awk -i inplace 'NR==13{print " modules.rst"}1' index.rst
make html
cd ..
echo -e "\nopen docs/_build/html/index.html\n"