|
41 | 41 | extensions = ['sphinx.ext.autodoc', 'sphinx.ext.autosummary', |
42 | 42 | 'sphinx.ext.doctest', 'sphinx.ext.coverage', |
43 | 43 | 'sphinx.ext.mathjax', 'sphinx.ext.viewcode', |
| 44 | + 'sphinx_gallery.gen_gallery', 'sphinx.ext.autosectionlabel', |
| 45 | + # sphinx.ext.autosexctionlabel raises duplicate label warnings |
| 46 | + # because same section headers are used multiple times throughout |
| 47 | + # the documentation. |
44 | 48 | 'numpydoc'] |
45 | 49 |
|
| 50 | + |
| 51 | +from sphinx_gallery.sorting import ExplicitOrder, FileNameSortKey |
| 52 | + |
46 | 53 | # Configure the extensions |
47 | 54 | numpydoc_show_class_members = False |
48 | 55 | autosummary_generate = True |
49 | 56 |
|
| 57 | +# prefix each section label with the name of the document it is in, in order to avoid |
| 58 | +# ambiguity when there are multiple same section labels in different documents. |
| 59 | +autosectionlabel_prefix_document = True |
| 60 | + |
| 61 | +# Sphinx-gallery configuration. |
| 62 | +sphinx_gallery_conf = { |
| 63 | + # path to the examples |
| 64 | + 'examples_dirs': '../examples', |
| 65 | + # path where to save gallery generated examples |
| 66 | + 'gallery_dirs': 'examples', |
| 67 | + #TODO: fix back/forward references for the examples. |
| 68 | + #'doc_module': ('autosklearn'), |
| 69 | + #'reference_url': { |
| 70 | + # 'autosklearn': None |
| 71 | + #}, |
| 72 | + #'backreferences_dir': 'gen_modules/backreferences' |
| 73 | +} |
| 74 | + |
50 | 75 | # Add any paths that contain templates here, relative to this directory. |
51 | 76 | templates_path = ['_templates'] |
52 | 77 |
|
|
134 | 159 | ('Releases', 'releases'), |
135 | 160 | ('Installation', 'installation'), |
136 | 161 | ('Manual', 'manual'), |
| 162 | + ('Examples', 'examples/index'), |
137 | 163 | ('API', 'api'), |
138 | 164 | ('Extending', 'extending'), |
139 | 165 | ], |
|
0 commit comments