forked from Trophime/course.prepost
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathantora-preview.sh
executable file
·54 lines (47 loc) · 1.79 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
#!/bin/bash
set +x
# install feelpp stuff
sudo apt-get install wget gpg
wget -qO - http://apt.feelpp.org/apt.gpg | sudo apt-key add -
echo "deb http://apt.feelpp.org/debian/bookworm bookworm latest" | sudo tee -a /etc/apt/sources.list.d/feelpp.list
rm -f feelpp.gpg
sudo apt -qq update
# sudo apt install -y
# install python stuff
sudo apt install -y python-is-python3 python3-venv
python3 -m venv --system-site-packages .venv
source .venv/bin/activate
pip3 install -r requirements.txt
# install utilities tools
sudo apt install -y pandoc
# install firefox for LiveServer
dist=$(lsb_release -ds | cut -d " " -f 1)
echo "dist=${dist}xxx"
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
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-dev.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`