@@ -72,13 +72,18 @@ Other useful invocations include
7272
7373.. code-block :: sh
7474
75- # Delete built files. May help if you get errors about missing paths or
76- # broken links.
75+ # Delete built files. May help if you get errors about
76+ # missing paths or broken links.
7777 make clean
7878
7979 # Build pdf docs.
8080 make latexpdf
8181
82+ Linux, macOS
83+ ~~~~~~~~~~~~
84+ The documentation is built using the ``Makefile `` file and parameters
85+ can be set either in the ``Makefile `` or on the command line.
86+
8287The ``SPHINXOPTS `` variable is set to ``-W `` by default to turn warnings into
8388errors. To unset it, use
8489
@@ -88,16 +93,95 @@ errors. To unset it, use
8893
8994 You can use the ``O `` variable to set additional options:
9095
91- * ``make O=-j4 html `` runs a parallel build with 4 processes.
92- * ``make O=-Dplot_formats=png:100 html `` saves figures in low resolution.
93- * ``make O=-Dplot_gallery=0 html `` skips the gallery build.
96+ .. code-block :: sh
97+
98+ # runs a parallel build with 4 processes.
99+ make O=-j4 html
100+
101+ # saves figures in low resolution.
102+ make O=-Dplot_formats=png:100 html
103+
104+ # builds the gallery without executing the scripts
105+ make O=-Dplot_gallery=0 html
106+
107+ # Multiple options can be combined using e.g.
108+ make O=' -j4 -Dplot_gallery=0' html
109+
110+ Windows
111+ ~~~~~~~
112+ .. note ::
113+
114+ It is currently not possible to build the gallery on windows due to a
115+ problem in sphinx-gallery that should be fixed in version 0.1.14. A
116+ workaround is to not build the gallery by commenting out
117+ ``sphinx_gallery.gen_gallery `` in ``extensions `` in the ``conf.py `` file.
118+
119+ The documentation is build using the ``make.bat `` file. The options are set using
120+ environment variables and varibales can be set either in the
121+ ``make.bat `` file or set on the command line befor running ``make.bat ``.
122+
123+ Environment variables are set with
124+
125+ .. code-block :: sh
126+
127+ # in cmd
128+ set SPHINXOPTS=-W
129+ set O=-Dplot_gallery=0
130+
131+ # in powershell
132+ Set-Item env:SPHINXOPTS " -W"
133+ Set-Item env:O " -Dplot_gallery=0"
134+
135+ The ``SPHINXOPTS `` variable is set to ``-W `` by default to turn warnings into
136+ errors. To unset it, set the ``SPHINXOPTS `` variable to any argument except
137+ nothing. A space can used to overide the default.
138+
139+ .. code-block :: sh
140+
141+ # in cmd
142+ # use the default -W option
143+ make html
144+ set SPHINXOPTS=& make html
145+
146+ # to not use the default
147+ set SPHINXOPTS= & make html
148+
149+ You can use the ``O `` variable to set additional options, for example (see
150+ linux, macOS above for more options)
151+
152+ .. code-block :: sh
94153
95- Multiple options can be combined using e.g. ``make O='-j4 -Dplot_gallery=0'
96- html ``.
154+ set O=-j4 -Dplot_gallery=0
155+
156+ The total command is then run with
97157
98- On Windows, options needs to be set as environment variables, e.g. ``set O=-W
99- -j4 & make html ``.
158+ .. code-block :: sh
159+
160+ # in cmd
161+ set O=-Dplot_gallery=0
162+ make html
163+
164+ # or on one line
165+ set O=-Dplot_gallery=0 & make html
166+
167+ # in powershell
168+ Set-Item env:O " -Dplot_gallery=0"
169+ .\m ake html
170+
171+ # or on one line
172+ Set-Item env:O " -Dplot_gallery=0" ; .\m ake html
173+
174+ Both ``SPHINXOPTS `` and ``O `` are unset at the end of the ``make.bat `` file
175+ if cmd is used but not if
176+ powershell is used. So a variable must be unset manually with
177+
178+ .. code-block :: sh
100179
180+ Set-Item evn:O
181+
182+ in powershell before running ``make.bat `` again if the default behavior is
183+ wanted.
184+
101185.. _writing-rest-pages :
102186
103187Writing ReST pages
0 commit comments