Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile: Build doc in production mode #134

Merged
merged 2 commits into from
Oct 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading