generated from feelpp/course-project-dash
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathantora-preview.sh
executable file
·59 lines (49 loc) · 1.77 KB
/
antora-preview.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
set +x
# install feelpp stuff
./feelpp-install.sh
# install python stuff
sudo apt install -y python-is-python3 python3-venv libosmesa6
if [ ! -d .venv ]; then
python3 -m venv --system-site-packages .venv
source .venv/bin/activate
pip3 install -r requirements.txt
pip3 uninstall vtk -y
pip3 install --no-cache-dir --extra-index-url https://wheels.vtk.org vtk-osmesa
fi
source .venv/bin/activate
# install utilities tools
sudo apt install -y pandoc
# install firefox for LiveServer
dist=$(lsb_release -ds | cut -d " " -f 1)
echo "Install for dist=${dist}"
if [ "$dist" == "Ubuntu" ]; then
sudo apt -y install software-properties-common
sudo add-apt-repository -y ppa:mozillateam/ppa >> /tmp/output.txt 2>&1
sudo apt update
fi
sudo apt install -y firefox-esr libpci-dev
if [ $dist == "Ubuntu" ]; then
sudo ln -sf /usr/bin/firefox-esr /usr/bin/firefox
fi
# install
# sudo chown -R vscode:vscode . # in wsl remote container
# if base image is not node:xxxx
sudo apt install -y npm
npm install
# Generate website
npx antora --cache-dir=public/.cache/antora site.yml
# Launch Guard for files
echo ""
echo " ___________________________________________________________________________"
echo "| |"
echo "| Use VScode LiveServer to view the doc |"
echo "| Click on the icon at the bottom right of VSc windows to start the server |"
echo "|___________________________________________________________________________|"
echo ""
# sudo caddy start
# signalListener .. # from antora-preview but this seems buggy
guard -p --no-interactions -w docs public
# watchmedo auto-restart -d ./docs/ -p '*.adoc' --recursive `./antora-run.sh`
# properly quit virtual env
deactive