Skip to content

Commit

Permalink
Merge pull request #134 from stgraber/doc
Browse files Browse the repository at this point in the history
Makefile: Build doc in production mode
  • Loading branch information
stgraber authored Oct 7, 2023
2 parents 2fbe867 + b492e21 commit 7181b0f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
18 changes: 7 additions & 11 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7181b0f

Please sign in to comment.