/ docs / api_reference / Makefile
Makefile
  1  # Makefile for Sphinx documentation
  2  #
  3  
  4  # You can set these variables from the command line.
  5  SPHINXOPTS    = -W --keep-going -n -T
  6  SPHINXBUILD   = sphinx-build
  7  PAPER         =
  8  BUILDDIR      = build
  9  
 10  # User-friendly check for sphinx-build
 11  ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
 12      $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don\'t have Sphinx installed, grab it from http://sphinx-doc.org/)
 13  endif
 14  
 15  # Internal variables.
 16  PAPEROPT_a4     = -D latex_paper_size=a4
 17  PAPEROPT_letter = -D latex_paper_size=letter
 18  ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
 19  # the i18n builder cannot share the environment and doctrees with the others
 20  I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
 21  
 22  .PHONY: default
 23  default: html
 24  
 25  .PHONY: help
 26  help:
 27  	@echo "Please use \`make <target>' where <target> is one of"
 28  	@echo "  html       to make standalone HTML files"
 29  	@echo "  dirhtml    to make HTML files named index.html in directories"
 30  	@echo "  singlehtml to make a single large HTML file"
 31  	@echo "  pickle     to make pickle files"
 32  	@echo "  json       to make JSON files"
 33  	@echo "  htmlhelp   to make HTML files and a HTML help project"
 34  	@echo "  qthelp     to make HTML files and a qthelp project"
 35  	@echo "  applehelp  to make an Apple Help Book"
 36  	@echo "  devhelp    to make HTML files and a Devhelp project"
 37  	@echo "  epub       to make an epub"
 38  	@echo "  epub3      to make an epub3"
 39  	@echo "  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
 40  	@echo "  latexpdf   to make LaTeX files and run them through pdflatex"
 41  	@echo "  latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
 42  	@echo "  text       to make text files"
 43  	@echo "  man        to make manual pages"
 44  	@echo "  texinfo    to make Texinfo files"
 45  	@echo "  info       to make Texinfo files and run them through makeinfo"
 46  	@echo "  gettext    to make PO message catalogs"
 47  	@echo "  changes    to make an overview of all changed/added/deprecated items"
 48  	@echo "  xml        to make Docutils-native XML files"
 49  	@echo "  pseudoxml  to make pseudoxml-XML files for display purposes"
 50  	@echo "  linkcheck  to check all external links for integrity"
 51  	@echo "  doctest    to run all doctests embedded in the documentation (if enabled)"
 52  	@echo "  coverage   to run coverage check of the documentation (if enabled)"
 53  	@echo "  dummy      to check syntax errors of document sources"
 54  
 55  .PHONY: clean
 56  clean:
 57  	rm -rf $(BUILDDIR)/*
 58  
 59  .PHONY: javadocs
 60  javadocs:
 61  	./build-javadoc.sh
 62  
 63  .PHONY: rdocs
 64  rdocs:
 65  	./build-rdoc.sh
 66  
 67  .PHONY: tsdocs
 68  tsdocs:
 69  	./build-tsdoc.sh
 70  
 71  .PHONY: test-examples
 72  test-examples:
 73  	@pytest --no-cov .examples
 74  
 75  .PHONY: gateway-api-docs
 76  gateway-api-docs:
 77  	@python gateway_api_docs.py
 78  
 79  # Builds only the RST-based documentation (i.e., everything but Java & R docs)
 80  .PHONY: rsthtml
 81  rsthtml: gateway-api-docs
 82  	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
 83  	@echo
 84  	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
 85  	@echo "Use 'make view' to preview docs."
 86  
 87  .PHONY: view
 88  view:
 89  	python -m http.server --directory build/html
 90  
 91  .PHONY: html
 92  html: rdocs rsthtml javadocs tsdocs
 93  
 94  .PHONY: dirhtml
 95  dirhtml:
 96  	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
 97  	@echo
 98  	@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
 99  
100  .PHONY: singlehtml
101  singlehtml:
102  	$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
103  	@echo
104  	@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
105  
106  .PHONY: livehtml
107  livehtml:
108  	# Remove `--keep-going` option because `sphinx-autobuild` doesn't support it and raises an error.
109  	# See: https://github.com/executablebooks/sphinx-autobuild/blob/master/src/sphinx_autobuild/build.py#L7
110  	sphinx-autobuild -b html $(shell echo $(ALLSPHINXOPTS) | sed -e "s/--keep-going//g") $(BUILDDIR)/html
111  
112  .PHONY: pickle
113  pickle:
114  	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
115  	@echo
116  	@echo "Build finished; now you can process the pickle files."
117  
118  .PHONY: json
119  json:
120  	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
121  	@echo
122  	@echo "Build finished; now you can process the JSON files."
123  
124  .PHONY: htmlhelp
125  htmlhelp:
126  	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
127  	@echo
128  	@echo "Build finished; now you can run HTML Help Workshop with the" \
129  	      ".hhp project file in $(BUILDDIR)/htmlhelp."
130  
131  .PHONY: qthelp
132  qthelp:
133  	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
134  	@echo
135  	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
136  	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
137  	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/twitterpandas.qhcp"
138  	@echo "To view the help file:"
139  	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/twitterpandas.qhc"
140  
141  .PHONY: applehelp
142  applehelp:
143  	$(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
144  	@echo
145  	@echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
146  	@echo "N.B. You won't be able to view it unless you put it in" \
147  	      "~/Library/Documentation/Help or install it in your application" \
148  	      "bundle."
149  
150  .PHONY: devhelp
151  devhelp:
152  	$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
153  	@echo
154  	@echo "Build finished."
155  	@echo "To view the help file:"
156  	@echo "# mkdir -p $$HOME/.local/share/devhelp/twitterpandas"
157  	@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/twitterpandas"
158  	@echo "# devhelp"
159  
160  .PHONY: epub
161  epub:
162  	$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
163  	@echo
164  	@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
165  
166  .PHONY: epub3
167  epub3:
168  	$(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3
169  	@echo
170  	@echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3."
171  
172  .PHONY: latex
173  latex:
174  	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
175  	@echo
176  	@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
177  	@echo "Run \`make' in that directory to run these through (pdf)latex" \
178  	      "(use \`make latexpdf' here to do that automatically)."
179  
180  .PHONY: latexpdf
181  latexpdf:
182  	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
183  	@echo "Running LaTeX files through pdflatex..."
184  	$(MAKE) -C $(BUILDDIR)/latex all-pdf
185  	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
186  
187  .PHONY: latexpdfja
188  latexpdfja:
189  	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
190  	@echo "Running LaTeX files through platex and dvipdfmx..."
191  	$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
192  	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
193  
194  .PHONY: text
195  text:
196  	$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
197  	@echo
198  	@echo "Build finished. The text files are in $(BUILDDIR)/text."
199  
200  .PHONY: man
201  man:
202  	$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
203  	@echo
204  	@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
205  
206  .PHONY: texinfo
207  texinfo:
208  	$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
209  	@echo
210  	@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
211  	@echo "Run \`make' in that directory to run these through makeinfo" \
212  	      "(use \`make info' here to do that automatically)."
213  
214  .PHONY: info
215  info:
216  	$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
217  	@echo "Running Texinfo files through makeinfo..."
218  	make -C $(BUILDDIR)/texinfo info
219  	@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
220  
221  .PHONY: gettext
222  gettext:
223  	$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
224  	@echo
225  	@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
226  
227  .PHONY: changes
228  changes:
229  	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
230  	@echo
231  	@echo "The overview file is in $(BUILDDIR)/changes."
232  
233  .PHONY: linkcheck
234  linkcheck:
235  	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
236  	@echo
237  	@echo "Link check complete; look for any errors in the above output " \
238  	      "or in $(BUILDDIR)/linkcheck/output.txt."
239  
240  .PHONY: doctest
241  doctest:
242  	$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
243  	@echo "Testing of doctests in the sources finished, look at the " \
244  	      "results in $(BUILDDIR)/doctest/output.txt."
245  
246  .PHONY: coverage
247  coverage:
248  	$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
249  	@echo "Testing of coverage in the sources finished, look at the " \
250  	      "results in $(BUILDDIR)/coverage/python.txt."
251  
252  .PHONY: xml
253  xml:
254  	$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
255  	@echo
256  	@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
257  
258  .PHONY: pseudoxml
259  pseudoxml:
260  	$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
261  	@echo
262  	@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
263  
264  .PHONY: dummy
265  dummy:
266  	$(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/dummy
267  	@echo
268  	@echo "Build finished. Dummy builder generates no files."