Skip to content

Commit 838930e

Browse files
authored
[MRG+1] [DOC, ENH] Add binder links to documentation (nilearn#2300)
* infra: inital commit of binder infra * enh: update conf.py for Binder configuration * enh: build from master branch for Binder config * tmp: use emdupre built documentation for binder infra * infra: update binder dependencies * fix: update to nilearn.github.io * sty: update CSS for sphx-glr-download-link-note * sty: updates download note to match sphinx admonition styling * doc: update whats_new
1 parent e447a70 commit 838930e

File tree

5 files changed

+45
-2
lines changed

5 files changed

+45
-2
lines changed

doc/binder/requirements.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-r ./requirements-build-docs.txt
2+
nilearn>=0.6.1

doc/conf.py

+12
Original file line numberDiff line numberDiff line change
@@ -302,14 +302,26 @@
302302
'backreferences_dir': os.path.join('modules', 'generated'),
303303
'reference_url': {'nilearn': None},
304304
'junit': '../test-results/sphinx-gallery/junit.xml',
305+
'examples_dirs': '../examples',
306+
'gallery_dirs': 'auto_examples',
307+
'binder': {
308+
'org': 'nilearn',
309+
'repo': 'nilearn.github.io',
310+
'binderhub_url': 'https://mybinder.org',
311+
'branch': 'master',
312+
'dependencies': ['../requirements-build-docs.txt',
313+
'binder/requirements.txt'],
314+
'notebooks_dir': 'examples'
305315
}
316+
}
306317

307318
# Get rid of spurious warnings due to some interaction between
308319
# autosummary and numpydoc. See
309320
# https://github.com/phn/pytpm/issues/3#issuecomment-12133978 for more
310321
# details
311322
numpydoc_show_class_members = False
312323

324+
313325
def touch_example_backreferences(app, what, name, obj, options, lines):
314326
# generate empty examples files, so that we don't get
315327
# inclusion errors if there are no examples for a class / module

doc/themes/nilearn/static/nature.css_t

+11
Original file line numberDiff line numberDiff line change
@@ -1708,3 +1708,14 @@ div.sg-report iframe {
17081708
margin-bottom: 0pt;
17091709
width: 126%; /* More than 100% because of .8 scaling */
17101710
}
1711+
1712+
/* gallery download note */
1713+
1714+
div.body div.sphx-glr-download-link-note {
1715+
text-align: left;
1716+
float: none;
1717+
margin: 10px 0 -10px 0;
1718+
border-radius: 4px;
1719+
padding: 5px;
1720+
max-width: 100%;
1721+
}

doc/whats_new.rst

+19
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
0.6.2
2+
======
3+
4+
ENHANCEMENTS
5+
------------
6+
7+
- Generated documentation now includes Binder links to launch examples interactively
8+
in the browser
9+
10+
Contributors
11+
------------
12+
13+
The following people contributed to this release::
14+
15+
Elizabeth DuPre
16+
Zvi Baratz
17+
Kshitij Chawla (kchawla-pi)
18+
19+
120
0.6.1
221
=====
322

requirements-build-docs.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
numpy
2-
pandas
32
cython
43
scipy
54
flake8
@@ -14,4 +13,4 @@ pandas
1413
nibabel
1514
scikit-learn
1615
joblib
17-
matplotlib
16+
matplotlib

0 commit comments

Comments
 (0)