a b/doc/Makefile
1
# Makefile for Sphinx documentation
2
#
3
4
# You can set these variables from the command line.
5
SPHINXOPTS    = -nWT --keep-going
6
SPHINXBUILD   = sphinx-build
7
MPROF         = SG_STAMP_STARTS=true mprof run -E --python sphinx
8
9
# Internal variables.
10
ALLSPHINXOPTS   = -d _build/doctrees $(SPHINXOPTS) .
11
12
.PHONY: help clean html html-noplot html-pattern linkcheck linkcheck-grep doctest
13
14
# make with no arguments will build the first target by default, i.e., build standalone HTML files
15
first_target: html-noplot
16
17
help:
18
    @echo "Please use \`make <target>' where <target> is one of"
19
    @echo "  html             to make standalone HTML files"
20
    @echo "  html-memory      to make standalone HTML files while monitoring memory usage"
21
    @echo "  html-pattern     to make standalone HTML files for a specific filename pattern"
22
    @echo "  html-front       to make standalone HTML files with only the frontpage examples"
23
    @echo "  html-noplot      to make standalone HTML files without plotting"
24
    @echo "  clean            to clean HTML files"
25
    @echo "  linkcheck        to check all external links for integrity"
26
    @echo "  linkcheck-grep   to grep the linkcheck result"
27
    @echo "  doctest          to run all doctests embedded in the documentation (if enabled)"
28
    @echo "  view             to view the built HTML"
29
30
clean:
31
    -rm -rf _build sg_execution_times.rst auto_examples auto_tutorials generated *.stc *.fif *.nii.gz
32
33
html:
34
    $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) _build/html
35
    @echo
36
    @echo "Build finished. The HTML pages are in _build/html."
37
38
html-memory:
39
    $(MPROF) -b html $(ALLSPHINXOPTS) _build/html
40
    @echo
41
    @echo "Build finished. The HTML pages are in _build/html."
42
43
html-pattern:
44
    $(SPHINXBUILD) -D sphinx_gallery_conf.filename_pattern=$(PATTERN) -D sphinx_gallery_conf.run_stale_examples=True -b html $(ALLSPHINXOPTS) _build/html
45
    @echo
46
    @echo "Build finished. The HTML pages are in _build/html"
47
48
html-pattern-memory:
49
    $(MPROF) -D sphinx_gallery_conf.filename_pattern=$(PATTERN) -D sphinx_gallery_conf.run_stale_examples=True -b html $(ALLSPHINXOPTS) _build/html
50
    @echo
51
    @echo "Build finished. The HTML pages are in _build/html"
52
53
html-noplot:
54
    $(SPHINXBUILD) -D plot_gallery=0 -b html $(ALLSPHINXOPTS) _build/html
55
    @echo
56
    @echo "Build finished. The HTML pages are in _build/html."
57
58
html-front:
59
    @PATTERN="\(30_mne_dspm_loreta.py\|50_decoding.py\|30_strf.py\|20_cluster_1samp_spatiotemporal.py\|20_visualize_evoked.py\)" make html-pattern
60
61
# Aliases for old methods
62
html_dev-pattern-memory: html-pattern-memory
63
html_dev-pattern: html-pattern
64
html_dev-noplot: html-noplot
65
html_dev-front: html-front
66
67
linkcheck:
68
    @$(SPHINXBUILD) -b linkcheck -D nitpicky=0 -q -D plot_gallery=0 -D exclude_patterns="cited.rst,whats_new.rst,configure_git.rst,_includes,changes/devel" -d _build/doctrees . _build/linkcheck
69
70
doctest:
71
    $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) _build/doctest
72
    @echo "Testing of doctests in the sources finished, look at the " \
73
          "results in _build/doctest/output.txt."
74
75
view:
76
    @python -c "import webbrowser; webbrowser.open_new_tab('file://$(PWD)/_build/html/sg_execution_times.html')"
77
78
show: view
79
80
serve:
81
    python -m http.server -d _build/html