From 31ce89e962fe170e21a2f5caad4e5296d0b01b09 Mon Sep 17 00:00:00 2001 From: Jirka Borovec <6035284+Borda@users.noreply.github.com> Date: Thu, 3 Oct 2024 20:59:59 +0200 Subject: [PATCH] docs: try autobuild for local dev (#2518) --- Makefile | 7 ++++++- docs/Makefile | 3 +++ requirements/_docs.txt | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 92b255c2cc3..7ab37aab29d 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ -.PHONY: clean test get-sphinx-template docs env data +.PHONY: clean test get-sphinx-template docs live-docs env data +export TOKENIZERS_PARALLELISM=false export FREEZE_REQUIREMENTS=1 # assume you have installed need packages export SPHINX_MOCK_REQUIREMENTS=1 @@ -39,6 +40,10 @@ docs: clean get-sphinx-template # apt-get install -y texlive-latex-extra dvipng texlive-pictures texlive-fonts-recommended cm-super cd docs && make html --debug --jobs $(nproc) SPHINXOPTS="-W --keep-going" +live-docs: get-sphinx-template + pip install -e . --quiet -r requirements/_docs.txt + cd docs && make livehtml --jobs $(nproc) + env: pip install -e . -U -r requirements/_devel.txt diff --git a/docs/Makefile b/docs/Makefile index 35e5650808f..bae43786043 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -17,3 +17,6 @@ help: # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +livehtml: + sphinx-autobuild "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/requirements/_docs.txt b/requirements/_docs.txt index fdc774fe73b..6ae990e7e7e 100644 --- a/requirements/_docs.txt +++ b/requirements/_docs.txt @@ -9,6 +9,7 @@ sphinx-autodoc-typehints ==1.23.0 sphinx-paramlinks ==0.6.0 sphinx-togglebutton ==0.3.2 sphinx-copybutton ==0.5.2 +sphinx-autobuild ==2024.10.3 sphinx-gallery ==0.17.1 lightning >=1.8.0, <2.5.0