|
31 | 31 | import sys
|
32 | 32 | sys.path.insert(0, os.path.abspath('.'))
|
33 | 33 | sys.path.insert(0, os.path.abspath('./.jenkins'))
|
34 |
| -import pytorch_sphinx_theme |
| 34 | +import pytorch_sphinx_theme2 |
| 35 | + |
| 36 | +html_theme = "pytorch_sphinx_theme2" |
| 37 | +html_theme_path = [pytorch_sphinx_theme2.get_html_theme_path()] |
35 | 38 | import torch
|
36 | 39 | import numpy
|
37 | 40 | import gc
|
|
84 | 87 | 'sphinx_gallery.gen_gallery',
|
85 | 88 | 'sphinx_design',
|
86 | 89 | 'sphinx_sitemap'
|
| 90 | + 'sphinxcontrib.mermaid', |
| 91 | + 'myst_parser' |
| 92 | +] |
| 93 | + |
| 94 | +myst_enable_extensions = [ |
| 95 | + "colon_fence", |
| 96 | + "deflist", |
| 97 | + "html_image", |
87 | 98 | ]
|
88 | 99 |
|
89 | 100 | intersphinx_mapping = {
|
@@ -136,6 +147,81 @@ def reset_seeds(gallery_conf, fname):
|
136 | 147 | ]
|
137 | 148 | sitemap_url_scheme = "{link}"
|
138 | 149 |
|
| 150 | +html_theme_options = { |
| 151 | + "navigation_with_keys": False, |
| 152 | + "analytics_id": "GTM-T8XT4PS", |
| 153 | + "pytorch_project": "tutorials", |
| 154 | + "logo": { |
| 155 | + "text": "Home", |
| 156 | + }, |
| 157 | + "language_bindings_links": [ |
| 158 | + { |
| 159 | + "url": "https://pytorch.org/docs/stable/cpp_index.html", |
| 160 | + "name": "C++", |
| 161 | + }, |
| 162 | + { |
| 163 | + "url": "https://pytorch.org/javadoc/", |
| 164 | + "name": "Javadoc", |
| 165 | + }, |
| 166 | + { |
| 167 | + "url": "https://github.com/pytorch/multipy", |
| 168 | + "name": "torch.multiply", |
| 169 | + }, |
| 170 | + ], |
| 171 | + "external_links": [ |
| 172 | + { |
| 173 | + "name": "Tutorials", |
| 174 | + "url": "https://pytorch.org/tutorials/", |
| 175 | + }, |
| 176 | + ], |
| 177 | + "icon_links": [ |
| 178 | + { |
| 179 | + "name": "X", |
| 180 | + "url": "https://x.com/PyTorch", |
| 181 | + "icon": "fa-brands fa-x-twitter", |
| 182 | + }, |
| 183 | + { |
| 184 | + "name": "GitHub", |
| 185 | + "url": "https://github.com/pytorch/pytorch", |
| 186 | + "icon": "fa-brands fa-github", |
| 187 | + }, |
| 188 | + { |
| 189 | + "name": "Discourse", |
| 190 | + "url": "https://dev-discuss.pytorch.org/", |
| 191 | + "icon": "fa-brands fa-discourse", |
| 192 | + }, |
| 193 | + { |
| 194 | + "name": "PyPi", |
| 195 | + "url": "https://pypi.org/project/torch/", |
| 196 | + "icon": "fa-brands fa-python", |
| 197 | + }, |
| 198 | + ], |
| 199 | + "use_edit_page_button": True, |
| 200 | + "logo": { |
| 201 | + "text": "Home", |
| 202 | + }, |
| 203 | +} |
| 204 | + |
| 205 | +theme_variables = pytorch_sphinx_theme2.get_theme_variables() |
| 206 | + |
| 207 | +html_context = { |
| 208 | + "theme_variables": theme_variables, |
| 209 | + "display_github": True, |
| 210 | + "github_url": "https://github.com", |
| 211 | + "github_user": "pytorch", |
| 212 | + "github_repo": "pytorch", |
| 213 | + "feedback_url": "https://github.com/pytorch/tutorials", |
| 214 | + "github_version": "main", |
| 215 | + "doc_path": "docs/source", |
| 216 | + "library_links": theme_variables.get("library_links", []), |
| 217 | + "icon_links": theme_variables.get("icon_links", []), |
| 218 | + "community_links": theme_variables.get("community_links", []), |
| 219 | + "pytorch_project": "docs", |
| 220 | + "language_bindings_links": html_theme_options.get("language_bindings_links", []), |
| 221 | +} |
| 222 | + |
| 223 | + |
| 224 | + |
139 | 225 | if os.getenv('GALLERY_PATTERN'):
|
140 | 226 | # GALLERY_PATTERN is to be used when you want to work on a single
|
141 | 227 | # tutorial. Previously this was fed into filename_pattern, but
|
|
0 commit comments