-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathimport-python-docs.sh
More file actions
executable file
·42 lines (36 loc) · 1 KB
/
import-python-docs.sh
File metadata and controls
executable file
·42 lines (36 loc) · 1 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
#!/bin/bash
# Usage
#
# 1. Activate a Python virtualenv where the correct spectacularAI
# Python package version has been installed
#
# 2. Install additional tools:
#
# pip install sphinx sphinx-tabs myst-parser breathe sphinx-rtd-theme
#
# 3. Run this script in the root folder of this repo (docs)
#
# ./import-python-docs.sh MAJOR.MINOR
#
# where MAJOR.MINOR is the latest SDK version for which to generate
# the docs, e.g. 1.26. Do not include the patch version or "v"
#
set -eux
export SDK_VERSION="v$1"
: "${SDK_PRIVATE_PATH:="../vio"}"
CUR=`pwd`
WORK=$(mktemp -d)
cd "$SDK_PRIVATE_PATH"
./scripts/docs/build_html.sh "$WORK"
cd "$CUR"
languages=("python" "cpp")
for l in $languages; do
rm -rf "$CUR/sdk/$l/latest"
mv "$WORK/$l/latest" "$CUR/sdk/$l/"
rm -rf "$CUR/sdk/$l/$SDK_VERSION"
cp -R "$CUR/sdk/$l/latest" "$CUR/sdk/$l/$SDK_VERSION"
rm -rf "$WORK/$l"
done
rm -rf "$WORK/_sources" "$WORK/objects.inv" "$WORK/genindex.html" "$WORK/py-modindex.html"
cp -R "$WORK/"* "$CUR/sdk/"
rm -rf "$WORK"