1515import os , subprocess
1616import shlex
1717import recommonmark
18+ import sphinx_gallery
1819from recommonmark .parser import CommonMarkParser
1920from recommonmark .transform import AutoStructify
2021
5051 'sphinx.ext.autosummary' ,
5152 'sphinx.ext.intersphinx' ,
5253 'sphinx.ext.napoleon' ,
53- 'sphinx.ext.mathjax'
54+ 'sphinx.ext.mathjax' ,
55+ 'sphinx_gallery.gen_gallery' ,
5456]
5557
5658# Add any paths that contain templates here, relative to this directory.
129131# Add any paths that contain custom static files (such as style sheets) here,
130132# relative to this directory. They are copied after the builtin static files,
131133# so a file named "default.css" will overwrite the builtin "default.css".
132- html_static_path = ['_static' ]
134+ # html_static_path = ['_static']
133135
134136# Output file base name for HTML help builder.
135137htmlhelp_basename = project + 'doc'
@@ -164,9 +166,17 @@ def run_doxygen(folder):
164166 'numpy' : ('http://docs.scipy.org/doc/numpy/' , None ),
165167 'scipy' : ('http://docs.scipy.org/doc/scipy/reference' , None ),
166168 'matplotlib' : ('http://matplotlib.org/' , None ),
169+ 'tvm' : ('http://docs.tvmlang.org/' , None ),
167170}
168171
169172
173+ from sphinx_gallery .sorting import ExplicitOrder
174+
175+ examples_dirs = ['../tutorials/' ]
176+ gallery_dirs = ['tutorials' ]
177+
178+ subsection_order = ExplicitOrder ([])
179+
170180def generate_doxygen_xml (app ):
171181 """Run the doxygen make commands if we're on the ReadTheDocs server"""
172182 run_doxygen ('..' )
@@ -180,3 +190,19 @@ def setup(app):
180190 'auto_doc_ref' : True
181191 }, True )
182192 app .add_transform (AutoStructify )
193+
194+
195+ sphinx_gallery_conf = {
196+ 'backreferences_dir' : 'gen_modules/backreferences' ,
197+ 'doc_module' : ('tvm' , 'nnvm' , 'numpy' ),
198+ 'reference_url' : {
199+ 'nnvm' : None ,
200+ 'tvm' : 'http://docs.tvmlang.org' ,
201+ 'numpy' : 'http://docs.scipy.org/doc/numpy-1.9.1' },
202+ 'examples_dirs' : examples_dirs ,
203+ 'gallery_dirs' : gallery_dirs ,
204+ 'subsection_order' : subsection_order ,
205+ 'find_mayavi_figures' : False ,
206+ 'filename_pattern' : '.py' ,
207+ 'expected_failing_examples' : []
208+ }
0 commit comments