From e4b00674184fb9be1bfe0f96e12bc571d8660f54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Tarot=20=28=40silopolis=29?= Date: Thu, 28 Dec 2023 17:27:40 +0100 Subject: [PATCH] scripts:docs_setup: Sets the docs development and building env up --- docs/requirements.in | 8 ++++---- requirements.txt | 31 ++++++++++++++++++------------- scripts/bootstrap.sh | 2 ++ scripts/docs_setup.sh | 28 ++++++++++++++++++++++++++++ 4 files changed, 52 insertions(+), 17 deletions(-) create mode 100755 scripts/docs_setup.sh diff --git a/docs/requirements.in b/docs/requirements.in index 46d6883..cb5cbce 100644 --- a/docs/requirements.in +++ b/docs/requirements.in @@ -1,17 +1,17 @@ mkdocs==1.5.3 -mkdocs-material==9.4.9 +mkdocs-material==9.5.3 +mkdocs-material[imaging]==9.5.3 #mkdocstrings[python] -markdown-include==0.8.1 mike==2.0.0 pygments==2.17.1 pymdown-extensions==10.4 +markdown-include==0.8.1 # FIXME TypeError: '<' not supported between instances of 'int' and 'str' #markdown-blockdiag @ git+https://github.com/silopolis/markdown-blockdiag@master mkdocs-awesome-pages-plugin==2.9.2 #mkdocs-literate-nav== mkdocs-section-index==0.3.8 mkdocs-git-revision-date-localized-plugin==1.2.1 -mkdocs-material[imaging]==9.4.9 mkdocs-ezglossary-plugin==1.5.5 mkdocs-kroki-plugin==0.6.1 mkdocs-macros-plugin==1.0.5 @@ -21,4 +21,4 @@ mkdocs-macros-plugin==1.0.5 # mkdocs-pdf-export-plugin # mkdocs-with-pdf # django-weasyprint -# mkdocs-include-markdown-plugin +mkdocs-include-markdown-plugin==6.0.4 diff --git a/requirements.txt b/requirements.txt index 95c87c1..1c8f7de 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,11 +4,11 @@ # # pip-compile --output-file=requirements.txt requirements.in # -anyio==4.0.0 +anyio==4.2.0 # via starlette asyncpg==0.27.0 # via -r requirements.app.in -babel==2.13.1 +babel==2.14.0 # via # mkdocs-git-revision-date-localized-plugin # mkdocs-material @@ -51,11 +51,11 @@ greenlet==3.0.1 # via sqlalchemy h11==0.14.0 # via uvicorn -idna==3.4 +idna==3.6 # via # anyio # requests -importlib-metadata==6.8.0 +importlib-metadata==7.0.1 # via mike importlib-resources==6.1.1 # via mike @@ -89,6 +89,7 @@ mkdocs==1.5.3 # mkdocs-awesome-pages-plugin # mkdocs-ezglossary-plugin # mkdocs-git-revision-date-localized-plugin + # mkdocs-include-markdown-plugin # mkdocs-kroki-plugin # mkdocs-macros-plugin # mkdocs-material @@ -99,13 +100,15 @@ mkdocs-ezglossary-plugin==1.5.5 # via -r docs/requirements.in mkdocs-git-revision-date-localized-plugin==1.2.1 # via -r docs/requirements.in +mkdocs-include-markdown-plugin==6.0.4 + # via -r docs/requirements.in mkdocs-kroki-plugin==0.6.1 # via -r docs/requirements.in mkdocs-macros-plugin==1.0.5 # via -r docs/requirements.in -mkdocs-material[imaging]==9.4.9 +mkdocs-material[imaging]==9.5.3 # via -r docs/requirements.in -mkdocs-material-extensions==1.3 +mkdocs-material-extensions==1.3.1 # via mkdocs-material mkdocs-section-index==0.3.8 # via -r docs/requirements.in @@ -119,7 +122,7 @@ packaging==23.2 # mkdocs paginate==0.5.6 # via mkdocs-material -pathspec==0.11.2 +pathspec==0.12.1 # via mkdocs pillow==9.5.0 # via @@ -127,7 +130,7 @@ pillow==9.5.0 # mkdocs-material pip-tools==7.3.0 # via -r requirements.python.in -platformdirs==4.0.0 +platformdirs==4.1.0 # via mkdocs psycopg2-binary==2.9.5 # via -r requirements.app.in @@ -164,7 +167,7 @@ pyyaml==6.0.1 # pyyaml-env-tag pyyaml-env-tag==0.1 # via mkdocs -regex==2023.10.3 +regex==2023.12.25 # via mkdocs-material requests==2.31.0 # via @@ -182,13 +185,13 @@ sqlalchemy==1.4.41 # ormar starlette==0.22.0 # via fastapi -termcolor==2.3.0 +termcolor==2.4.0 # via mkdocs-macros-plugin tinycss2==1.2.1 # via # cairosvg # cssselect2 -typing-extensions==4.8.0 +typing-extensions==4.9.0 # via pydantic urllib3==2.1.0 # via requests @@ -199,12 +202,14 @@ verspec==0.1.0 watchdog==3.0.0 # via mkdocs wcmatch==8.5 - # via mkdocs-awesome-pages-plugin + # via + # mkdocs-awesome-pages-plugin + # mkdocs-include-markdown-plugin webencodings==0.5.1 # via # cssselect2 # tinycss2 -wheel==0.41.3 +wheel==0.42.0 # via pip-tools zipp==3.17.0 # via importlib-metadata diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index 967a3bb..c65dbe5 100755 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -32,5 +32,7 @@ if [ -f .env ]; then source .env fi +./scripts/docs_setup.sh "$@" + ## and go back cd "$cwd" diff --git a/scripts/docs_setup.sh b/scripts/docs_setup.sh new file mode 100755 index 0000000..9aa556e --- /dev/null +++ b/scripts/docs_setup.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +set -e #ux + +## Record directory we are called from +cwd="$(pwd)" +## Change to project directory +cd "$(dirname "$0")/.." +if [ -f .env ]; then + # shellcheck source="../.env" disable=SC1091 + source .env +fi + +# shellcheck disable=SC2143 +if [[ ! $(pip -V) =~ .*\.venv.* ]]; then + echo "-- Activate Python virtual environment" + # shellcheck source="../.venv/bin/activate" + source .venv/bin/activate +fi + +echo "-- Install Python requirements for docs in venv" +pip install -r docs/requirements.in + +echo "-- Install Playwright browser dependency for PDF export" +playwright install firefox #chromium + +## and go back +cd "$cwd"