From 6e4152dcfa96b38b8940f6707f9ba9b4cd8e441e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Sat, 7 Oct 2023 11:13:57 -0400 Subject: [PATCH 1/2] Makefile: Build doc in production mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3603bb12348..13e382cf9fe 100644 --- a/Makefile +++ b/Makefile @@ -143,7 +143,7 @@ doc: doc-setup doc-incremental .PHONY: doc-incremental doc-incremental: @echo "Build the documentation" - . $(SPHINXENV) ; LOCAL_SPHINX_BUILD=True sphinx-build -c doc/ -b dirhtml doc/ doc/html/ -d doc/.sphinx/.doctrees -w doc/.sphinx/warnings.txt + . $(SPHINXENV) ; sphinx-build -c doc/ -b dirhtml doc/ doc/html/ -d doc/.sphinx/.doctrees -w doc/.sphinx/warnings.txt .PHONY: doc-serve doc-serve: From b492e21b5518bfca30f995985cb8d06298fbe103 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Sat, 7 Oct 2023 11:15:54 -0400 Subject: [PATCH 2/2] doc: Fix logic to find incus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber --- doc/conf.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index f3bada8d5cc..0d7a78d5c0e 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -22,18 +22,14 @@ os.symlink('../../deps/swagger-ui/dist/swagger-ui.css', '.sphinx/_static/swagger-ui/swagger-ui.css') ### MAN PAGES ### -# Find path to incus client (different for local builds and on RTD) -if ("LOCAL_SPHINX_BUILD" in os.environ and - os.environ["LOCAL_SPHINX_BUILD"] == "True"): - path = str(subprocess.check_output(['go', 'env', 'GOPATH'], encoding="utf-8").strip()) - incus = os.path.join(path, 'bin', 'incus') - if os.path.isfile(incus): - print("Using " + incus + " to generate man pages.") - else: - print("Cannot find incus in " + incus) - exit(2) +# Find the path to the incus binary +path = str(subprocess.check_output(['go', 'env', 'GOPATH'], encoding="utf-8").strip()) +incus = os.path.join(path, 'bin', 'incus') +if os.path.isfile(incus): + print("Using " + incus + " to generate man pages.") else: - incus = "../incus.bin" + print("Cannot find incus in " + incus) + exit(2) # Generate man pages content os.makedirs('.sphinx/deps/manpages', exist_ok=True)