File tree Expand file tree Collapse file tree 4 files changed +40
-7
lines changed Expand file tree Collapse file tree 4 files changed +40
-7
lines changed Original file line number Diff line number Diff line change 46
46
GOOGLE_CALENDAR_ID : ${{ secrets.GOOGLE_CALENDAR_ID }}
47
47
GOOGLE_CALENDAR_API_KEY : ${{ secrets.GOOGLE_CALENDAR_API_KEY }}
48
48
with :
49
- run : make docs
49
+ run : make docs GALLERY_PATH=examples/
50
50
51
51
- name : Upload artifact
52
52
uses : actions/upload-artifact@v2
Original file line number Diff line number Diff line change 1
1
.PHONY : docs clean
2
2
3
+ # Gallery path must be given relative to the docs/ folder
4
+
5
+ ifeq ($(GALLERY_PATH ) ,)
6
+ GALLERY_PATH := ../../napari/examples
7
+ endif
8
+
3
9
clean :
4
10
echo clean
5
11
rm -rf docs/_build/
@@ -12,15 +18,15 @@ docs-install:
12
18
13
19
docs-build :
14
20
python docs/_scripts/prep_docs.py
15
- NAPARI_APPLICATION_IPY_INTERACTIVE=0 sphinx-build -b html docs/ docs/_build
21
+ NAPARI_APPLICATION_IPY_INTERACTIVE=0 sphinx-build -b html docs/ docs/_build -D sphinx_gallery_conf.examples_dirs= $( GALLERY_PATH )
16
22
17
23
docs : clean docs-install docs-build
18
24
19
25
html : clean docs-build
20
26
21
27
html-noplot : clean
22
28
python -qr docs/_scripts/prep_docs.py
23
- NAPARI_APPLICATION_IPY_INTERACTIVE=0 sphinx-build -D plot_gallery=0 -b html docs/ docs/_build
29
+ NAPARI_APPLICATION_IPY_INTERACTIVE=0 sphinx-build -D plot_gallery=0 -b html docs/ docs/_build -D sphinx_gallery_conf.examples_dirs= $( GALLERY_PATH )
24
30
25
31
linkcheck-files :
26
- NAPARI_APPLICATION_IPY_INTERACTIVE=0 sphinx-build -b linkcheck -D plot_gallery=0 --color docs/ docs/_build
32
+ NAPARI_APPLICATION_IPY_INTERACTIVE=0 sphinx-build -b linkcheck -D plot_gallery=0 --color docs/ docs/_build -D sphinx_gallery_conf.examples_dirs= $( GALLERY_PATH )
Original file line number Diff line number Diff line change @@ -190,7 +190,8 @@ def reset_napari_theme(gallery_conf, fname):
190
190
qtgallery .reset_qapp (gallery_conf , fname )
191
191
192
192
sphinx_gallery_conf = {
193
- 'examples_dirs' : '../../napari/examples' , # path to your example scripts
193
+ #'examples_dirs': '../../napari/examples', # path to your example scripts
194
+ # this value is set in the Makefile
194
195
'gallery_dirs' : 'gallery' , # path to where to save gallery generated output
195
196
'filename_pattern' : '/*.py' ,
196
197
'ignore_pattern' : 'README.rst|/*_.py' ,
Original file line number Diff line number Diff line change @@ -215,11 +215,37 @@ clone of the `napari/docs` repository (assuming you've installed the
215
215
make docs
216
216
` ` `
217
217
218
- ` ` ` {note}
218
+ ` ` ` ` {note}
219
219
The `make docs` command above assumes your have a local clone of the
220
220
[`napari/napari`](https://github.com/napari/napari) repo at the same level as
221
- the `napari/docs` clone.
221
+ the `napari/docs` clone. If that's not the case, you can specify the location of
222
+ the examples gallery folder by executing
223
+
224
+ ` ` ` bash
225
+ make docs GALLERY_PATH=<path-to-examples-folder>
226
+ ` ` `
227
+
228
+ The `GALLERY_PATH` option must be given relative to the `docs` folder. If your
229
+ folder structure is
230
+
222
231
```
232
+ ├── napari-docs
233
+ │ └── docs
234
+ ├── napari
235
+ │ ├── binder
236
+ │ ├── examples
237
+ │ ├── napari
238
+ │ ├── napari_builtins
239
+ │ ├── resources
240
+ │ └── tools
241
+ ```
242
+
243
+ Then the command would be
244
+ ```bash
245
+ make docs GALLERY_PATH=../../napari/examples
246
+ ```
247
+
248
+ ````
223
249
224
250
The rendered HTML will be placed in `docs/_build`. Find `index.html` in this
225
251
folder and drag it into a browser to preview the website with your new document.
You can’t perform that action at this time.
0 commit comments