-
Notifications
You must be signed in to change notification settings - Fork 43
55 lines (48 loc) · 2.19 KB
/
sphinx.yml
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
name: 'Doc build (HTML & PDF)'
on:
push:
branches:
- master
jobs:
build-doc:
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@main
- name: Install
run: |
sudo apt update
sudo apt install nodejs npm
sudo apt install texlive-latex-recommended texlive-fonts-recommended texlive-latex-extra
pip install --upgrade pip
pip install Sphinx
pip install sphinxcontrib-inlinesyntaxhighlight
pip install sphinx-sitemap
git clone https://github.com/FreeFem/FreeFem-parser-pygments.git ~/pygments
sudo cp ~/pygments/freefem.py /usr/lib/python3/dist-packages/pygments/lexers/
(cd /usr/lib/python3/dist-packages/pygments/lexers/ && sudo python _mapping.py)
sed -i 's/, BaseTranslator//g' /home/runner/.local/lib/python3.12/site-packages/sphinxcontrib/inlinesyntaxhighlight.py
sed -i "s/self.highlightlang/'python'/g" /home/runner/.local/lib/python3.12/site-packages/sphinxcontrib/inlinesyntaxhighlight.py
- name: Build PDF
run: |
make clean
make latex
(cd build/latex && pdflatex -halt-on-error -interaction=nonstopmode -jobname FreeFEM-documentation FreeFEM.tex && makeindex FreeFEM-documentation.idx && pdflatex -halt-on-error -interaction=nonstopmode -jobname FreeFEM-documentation FreeFEM.tex)
(cd build/latex && md5sum FreeFEM-documentation.pdf >> FreeFEM-documentation.pdf.md5)
- name: Build HTML
run: |
make html
echo "doc.freefem.org" > build/html/CNAME
echo "TODO: Remove the PDF from the website repository at the next FreeFem-source release"
mkdir build/html/pdf && cp build/latex/FreeFEM-documentation.pdf build/html/pdf/
(cd build/html/pdf && md5sum FreeFEM-documentation.pdf >> FreeFEM-documentation.pdf.md5)
- name: Deploy HTML
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: build/html
- name: Deploy PDF
uses: JamesIves/[email protected]
with:
branch: pdf
folder: build/latex