improve search #85
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 /home/runner/.local/lib/python3.10/site-packages/pygments/lexers/ | |
(cd /home/runner/.local/lib/python3.10/site-packages/pygments/lexers/ && sudo python _mapping.py) | |
sed -i 's/, BaseTranslator//g' /home/runner/.local/lib/python3.10/site-packages/sphinxcontrib/inlinesyntaxhighlight.py | |
sed -i "s/self.highlightlang/'python'/g" /home/runner/.local/lib/python3.10/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 |