-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild-docs.sh
executable file
·38 lines (29 loc) · 1.11 KB
/
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
#!/bin/bash
# This script is used to build the documentation (for the vercel hosted website)
# Thus I didn't bother setting up stuff like venv here ;)
# The "python3 -m" prefixes are required to properly work on my Mac
# Switch to the directory of this file
cd "$( dirname "${BASH_SOURCE[0]}" )"
# Bundle/transpile the JavaScript file(s). This is similar to `build.sh`
cd typescript/
npm install
npm run build
cd ..
# Copy the JavaScript build output to the expected locations
[[ ! -d src/mkdocs_placeholder_plugin/assets/ ]] && mkdir src/mkdocs_placeholder_plugin/assets/
# Files for use by the plugin
cp typescript/build/placeholder.min.js* src/mkdocs_placeholder_plugin/assets/
# install the dependencies
python3 -m pip install -r requirements.txt
# also install the latest (dev) version of this package
python3 -m pip install .
# Vercel prefers outputs to be in public/
python3 -m mkdocs build -d public
# Files for download
cp typescript/build/placeholder.min.js* public/
build_with_theme() {
python3 -m mkdocs build -t "$1" -d public/"$1"
}
# Build with other themes
build_with_theme mkdocs
build_with_theme readthedocs