forked from divio/divio-cloud-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
71 lines (55 loc) · 2.12 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS +=
SPHINXBUILD = sphinx-build
SPHINXPROJ = DivioDocumentation
SOURCEDIR = .
BUILDDIR = _build
VENV = env/bin/activate
PORT = 9001
# list the targets that we don't want confused with files in the directory
.PHONY: help install clean run Makefile
# "help" is first so that "make" without an argument acts like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
install:
@echo "... setting up virtualenv"
python3 -m venv env
. $(VENV); pip install --upgrade -r requirements.txt
@echo "\n" \
"--------------------------------------------------------------- \n" \
"* watch, build and serve the documentation: make run \n" \
"* check spelling: make spelling \n" \
"\n" \
"enchant must be installed in order for pyenchant (and therefore \n" \
"spelling checks) to work. \n" \
"--------------------------------------------------------------- \n"
clean:
-rm -r $(BUILDDIR)/*
run:
. $(VENV); sphinx-autobuild $(ALLSPHINXOPTS) --ignore ".git/*" --ignore "*.scss" . -b dirhtml -a $(BUILDDIR)/html --host 0.0.0.0 --port $(PORT)
html:
. $(VENV); $(SPHINXBUILD) -b html . $(BUILDDIR)/html
open:
open $(BUILDDIR)/html/index.html
test:
. $(VENV); sphinx-build -b html . $(BUILDDIR)/html
spelling:
. $(VENV); $(SPHINXBUILD) -b spelling $(ALLSPHINXOPTS) . $(BUILDDIR)/spelling
@echo
@echo "Check finished. Wrong words can be found in " \
"$(BUILDDIR)/spelling/output.txt."
changes:
. $(VENV); $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) . $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
linkcheck:
. $(VENV); $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) . $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)