Skip to content

Commit 47bd86b

Browse files
authored
Allow building sphinx documentation locally via tox (#161)
* poetry add sphinx-autobuild --group docs * Added docs/Makefile * Updated version limit to: sphinx_celery, Sphinx, sphinx-testing, sphinx-click * Added tox envs: docs (-> make html), docs-livehtml (-> make livehtml) * Missing empty line at end of files * Added ".. _getting-started:" to docs/getting-started/index.rst
1 parent 983b774 commit 47bd86b

File tree

5 files changed

+429
-12
lines changed

5 files changed

+429
-12
lines changed

docs/Makefile

Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
# Makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = sphinx-build
7+
PAPER =
8+
BUILDDIR = _build
9+
SOURCEDIR = .
10+
APP = /docs
11+
12+
# Internal variables.
13+
PAPEROPT_a4 = -D latex_paper_size=a4
14+
PAPEROPT_letter = -D latex_paper_size=letter
15+
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
16+
# the i18n builder cannot share the environment and doctrees with the others
17+
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
18+
19+
.PHONY: help
20+
help:
21+
@echo "Please use \`make <target>' where <target> is one of"
22+
@echo " html to make standalone HTML files"
23+
@echo " livehtml to start a local server hosting the docs"
24+
@echo " dirhtml to make HTML files named index.html in directories"
25+
@echo " singlehtml to make a single large HTML file"
26+
@echo " pickle to make pickle files"
27+
@echo " json to make JSON files"
28+
@echo " htmlhelp to make HTML files and a HTML help project"
29+
@echo " qthelp to make HTML files and a qthelp project"
30+
@echo " applehelp to make an Apple Help Book"
31+
@echo " devhelp to make HTML files and a Devhelp project"
32+
@echo " epub to make an epub"
33+
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
34+
@echo " text to make text files"
35+
@echo " man to make manual pages"
36+
@echo " texinfo to make Texinfo files"
37+
@echo " gettext to make PO message catalogs"
38+
@echo " changes to make an overview of all changed/added/deprecated items"
39+
@echo " xml to make Docutils-native XML files"
40+
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
41+
@echo " linkcheck to check all external links for integrity"
42+
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
43+
@echo " coverage to run coverage check of the documentation (if enabled)"
44+
@echo " apicheck to verify that all modules are present in autodoc"
45+
@echo " configcheck to verify that all modules are present in autodoc"
46+
47+
.PHONY: clean
48+
clean:
49+
rm -rf $(BUILDDIR)/*
50+
51+
.PHONY: html
52+
html:
53+
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
54+
@echo
55+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
56+
57+
.PHONY: dirhtml
58+
dirhtml:
59+
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
60+
@echo
61+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
62+
63+
.PHONY: singlehtml
64+
singlehtml:
65+
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
66+
@echo
67+
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
68+
69+
.PHONY: pickle
70+
pickle:
71+
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
72+
@echo
73+
@echo "Build finished; now you can process the pickle files."
74+
75+
.PHONY: json
76+
json:
77+
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
78+
@echo
79+
@echo "Build finished; now you can process the JSON files."
80+
81+
.PHONY: htmlhelp
82+
htmlhelp:
83+
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
84+
@echo
85+
@echo "Build finished; now you can run HTML Help Workshop with the" \
86+
".hhp project file in $(BUILDDIR)/htmlhelp."
87+
88+
.PHONY: qthelp
89+
qthelp:
90+
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
91+
@echo
92+
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
93+
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
94+
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/PROJ.qhcp"
95+
@echo "To view the help file:"
96+
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/PROJ.qhc"
97+
98+
.PHONY: applehelp
99+
applehelp:
100+
$(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
101+
@echo
102+
@echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
103+
@echo "N.B. You won't be able to view it unless you put it in" \
104+
"~/Library/Documentation/Help or install it in your application" \
105+
"bundle."
106+
107+
.PHONY: devhelp
108+
devhelp:
109+
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
110+
@echo
111+
@echo "Build finished."
112+
@echo "To view the help file:"
113+
@echo "# mkdir -p $$HOME/.local/share/devhelp/PROJ"
114+
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/PROJ"
115+
@echo "# devhelp"
116+
117+
.PHONY: epub
118+
epub:
119+
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
120+
@echo
121+
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
122+
123+
.PHONY: latex
124+
latex:
125+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
126+
@echo
127+
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
128+
@echo "Run \`make' in that directory to run these through (pdf)latex" \
129+
"(use \`make latexpdf' here to do that automatically)."
130+
131+
.PHONY: text
132+
text:
133+
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
134+
@echo
135+
@echo "Build finished. The text files are in $(BUILDDIR)/text."
136+
137+
.PHONY: man
138+
man:
139+
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
140+
@echo
141+
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
142+
143+
.PHONY: texinfo
144+
texinfo:
145+
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
146+
@echo
147+
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
148+
@echo "Run \`make' in that directory to run these through makeinfo" \
149+
"(use \`make info' here to do that automatically)."
150+
151+
.PHONY: gettext
152+
gettext:
153+
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
154+
@echo
155+
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
156+
157+
.PHONY: changes
158+
changes:
159+
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
160+
@echo
161+
@echo "The overview file is in $(BUILDDIR)/changes."
162+
163+
.PHONY: linkcheck
164+
linkcheck:
165+
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
166+
@echo
167+
@echo "Link check complete; look for any errors in the above output " \
168+
"or in $(BUILDDIR)/linkcheck/output.txt."
169+
170+
.PHONY: doctest
171+
doctest:
172+
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
173+
@echo "Testing of doctests in the sources finished, look at the " \
174+
"results in $(BUILDDIR)/doctest/output.txt."
175+
176+
.PHONY: coverage
177+
coverage:
178+
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
179+
@echo "Testing of coverage in the sources finished, look at the " \
180+
"results in $(BUILDDIR)/coverage/python.txt."
181+
182+
.PHONY: apicheck
183+
apicheck:
184+
$(SPHINXBUILD) -b apicheck $(ALLSPHINXOPTS) $(BUILDDIR)/apicheck
185+
186+
.PHONY: configcheck
187+
configcheck:
188+
$(SPHINXBUILD) -b configcheck $(ALLSPHINXOPTS) $(BUILDDIR)/configcheck
189+
190+
.PHONY: xml
191+
xml:
192+
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
193+
@echo
194+
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
195+
196+
.PHONY: pseudoxml
197+
pseudoxml:
198+
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
199+
@echo
200+
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
201+
202+
.PHONY: livehtml
203+
livehtml:
204+
sphinx-autobuild -b html --host 0.0.0.0 --port 7010 --watch $(APP) -c . $(SOURCEDIR) $(BUILDDIR)/html

docs/getting-started/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _getting-started:
2+
13
=================
24
Getting Started
35
=================

0 commit comments

Comments
 (0)