Debian Codegraph @

docs/Makefile

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