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