From b01d10fd31e38486386cab9f6d574fae1991dd09 Mon Sep 17 00:00:00 2001 From: adigitoleo Date: Wed, 25 Sep 2024 14:06:13 +1000 Subject: [PATCH] docs: Add all_docs justfile target --- justfile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/justfile b/justfile index 3a2f12cb..9a88e286 100644 --- a/justfile +++ b/justfile @@ -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 @@ -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