mirror of
https://github.com/Start9Labs/documentation.git
synced 2026-03-26 10:21:53 +00:00
69 lines
2.0 KiB
Makefile
69 lines
2.0 KiB
Makefile
# You can set these variables from the command line.
|
|
POETRY = $(shell which poetry)
|
|
SPHINXOPTS = -j auto
|
|
SPHINXBUILD = $(POETRY) run sphinx-build
|
|
PAPER =
|
|
BUILDDIR = _build
|
|
SOURCEDIR = source
|
|
|
|
# Internal variables.
|
|
PAPEROPT_a4 = -D latex_paper_size=a4
|
|
PAPEROPT_letter = -D latex_paper_size=letter
|
|
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SOURCEDIR)
|
|
TESTSPHINXOPTS = $(ALLSPHINXOPTS) -W --keep-going
|
|
|
|
# the i18n builder cannot share the environment and doctrees with the others
|
|
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SOURCEDIR)
|
|
|
|
.PHONY: all
|
|
all: dirhtml
|
|
|
|
.PHONY: setup
|
|
setup:
|
|
./_utils/setup.sh
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
rm -rf $(BUILDDIR)/*
|
|
|
|
.PHONY: preview
|
|
preview:
|
|
npm --prefix ../sphinx-scylladb-theme run build
|
|
$(POETRY) run sphinx-autobuild -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml --port 5500
|
|
|
|
.PHONY: dirhtml
|
|
dirhtml: setup
|
|
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
|
|
@echo
|
|
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
|
|
|
|
.PHONY: singlehtml
|
|
singlehtml: setup
|
|
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
|
|
@echo
|
|
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
|
|
|
|
.PHONY: dummy
|
|
dummy: setup
|
|
$(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/dummy
|
|
@echo
|
|
@echo "Build finished. Dummy builder generates no files."
|
|
|
|
.PHONY: linkcheck
|
|
linkcheck: setup
|
|
$(SPHINXBUILD) -b linkcheck $(SOURCEDIR) $(BUILDDIR)/linkcheck
|
|
|
|
.PHONY: multiversion
|
|
multiversion: setup
|
|
npm --prefix ../sphinx-scylladb-theme run build
|
|
git diff --quiet || >&2 echo "\033[31;1;4mWARNING: Uncommitted changes will not be included in ./_build\033[0m"
|
|
@mkdir -p $(HOME)/.cache/pypoetry/virtualenvs
|
|
$(POETRY) run sphinx-multiversion source $(BUILDDIR)/dirhtml
|
|
@echo
|
|
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
|
|
|
|
.PHONY: multiversionpreview
|
|
multiversionpreview: multiversion
|
|
npm --prefix ../sphinx-scylladb-theme run build
|
|
$(POETRY) run python3 -m http.server 5500 --directory $(BUILDDIR)/dirhtml
|