Skip to content

Commit

Permalink
docs: Add all_docs justfile target
Browse files Browse the repository at this point in the history
  • Loading branch information
adigitoleo committed Sep 25, 2024
1 parent d753903 commit b01d10f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
VERSION := `python -m setuptools_scm -f plain`
TAGS := `git tag --sort=-committerdate --format='%(refname:short)'|grep -v rc`
TAG_LATEST := `git tag --sort=-committerdate --format='%(refname:short)'|grep -v rc|tail -1`

build:
python -m build
Expand Down Expand Up @@ -26,6 +28,24 @@ live_docs:
--footer-text "PyDRex {{VERSION}}" \
--math

all_docs:
# WARNING: --math fetches .js code from a CDN, be careful where it comes from:
# https://github.com/mitmproxy/pdoc/security/advisories/GHSA-5vgj-ggm4-fg62
for tag in {{TAGS}}; do \
git checkout "${tag}"; \
rm requirements.txt; \
./tools/venv_install.sh -u; \
echo "Building documentation for version ${tag}"; \
pdoc -t docs/template -o "html/${tag}" pydrex !pydrex.mesh !pydrex.distributed tests \
--favicon "https://raw.githubusercontent.com/seismic-anisotropy/PyDRex/main/docs/assets/favicon32.png" \
--footer-text "PyDRex $(python -m setuptools_scm -f plain)" \
--math; \
done
ln -s html/{{TAG_LATEST}}/index.html html/index.html
git checkout main
rm requirements.txt
./tools/venv_install.sh -u

clean:
rm -rf dist
rm -rf out
Expand Down

0 comments on commit b01d10f

Please sign in to comment.