forked from sony/custom_layers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerate_docs.sh
executable file
·37 lines (31 loc) · 933 Bytes
/
generate_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
#!/bin/bash -e
##########################################
# Generate API documentation.
# Usage:
# generate_docs.sh [--use-current-env]
##########################################
ROOT=$(dirname "${BASH_SOURCE[0]}")
DOCS_DIR=$ROOT/docs
if [ "$1" ];then
if [ "$1" != "--use-current-env" ];then
echo Unknown flag passed $1. Usage: generate_docs.sh [--use-current-env]
exit 1
fi
else
ENV_DIR=$(mktemp -d)
fi
if [ "$ENV_DIR" ];then
echo Building temp env $ENV_DIR
python3 -m venv $ENV_DIR
source $ENV_DIR/bin/activate
pip install -e $ROOT[tf,torch] pdoc --index-url https://download.pytorch.org/whl/cpu --extra-index-url https://pypi.org/simple
else
echo Using current env
fi
echo Generating docs
cd $ROOT
pdoc --docformat google -o $DOCS_DIR ./sony_custom_layers/{keras,pytorch} --no-include-undocumented --no-search -t ./pdoc/template
if [ "$ENV_DIR" ];then
echo Removing $ENV_DIR
rm -rf $ENV_DIR
fi