|
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 = {
|
@@ -130,6 +141,81 @@ def reset_seeds(gallery_conf, fname):
|
130 | 141 | ]
|
131 | 142 | sitemap_url_scheme = "{link}"
|
132 | 143 |
|
| 144 | +html_theme_options = { |
| 145 | + "navigation_with_keys": False, |
| 146 | + "analytics_id": "GTM-T8XT4PS", |
| 147 | + "pytorch_project": "tutorials", |
| 148 | + "logo": { |
| 149 | + "text": "Home", |
| 150 | + }, |
| 151 | + "language_bindings_links": [ |
| 152 | + { |
| 153 | + "url": "https://pytorch.org/docs/stable/cpp_index.html", |
| 154 | + "name": "C++", |
| 155 | + }, |
| 156 | + { |
| 157 | + "url": "https://pytorch.org/javadoc/", |
| 158 | + "name": "Javadoc", |
| 159 | + }, |
| 160 | + { |
| 161 | + "url": "https://github.com/pytorch/multipy", |
| 162 | + "name": "torch.multiply", |
| 163 | + }, |
| 164 | + ], |
| 165 | + "external_links": [ |
| 166 | + { |
| 167 | + "name": "Tutorials", |
| 168 | + "url": "https://pytorch.org/tutorials/", |
| 169 | + }, |
| 170 | + ], |
| 171 | + "icon_links": [ |
| 172 | + { |
| 173 | + "name": "X", |
| 174 | + "url": "https://x.com/PyTorch", |
| 175 | + "icon": "fa-brands fa-x-twitter", |
| 176 | + }, |
| 177 | + { |
| 178 | + "name": "GitHub", |
| 179 | + "url": "https://github.com/pytorch/pytorch", |
| 180 | + "icon": "fa-brands fa-github", |
| 181 | + }, |
| 182 | + { |
| 183 | + "name": "Discourse", |
| 184 | + "url": "https://dev-discuss.pytorch.org/", |
| 185 | + "icon": "fa-brands fa-discourse", |
| 186 | + }, |
| 187 | + { |
| 188 | + "name": "PyPi", |
| 189 | + "url": "https://pypi.org/project/torch/", |
| 190 | + "icon": "fa-brands fa-python", |
| 191 | + }, |
| 192 | + ], |
| 193 | + "use_edit_page_button": True, |
| 194 | + "logo": { |
| 195 | + "text": "Home", |
| 196 | + }, |
| 197 | +} |
| 198 | + |
| 199 | +theme_variables = pytorch_sphinx_theme2.get_theme_variables() |
| 200 | + |
| 201 | +html_context = { |
| 202 | + "theme_variables": theme_variables, |
| 203 | + "display_github": True, |
| 204 | + "github_url": "https://github.com", |
| 205 | + "github_user": "pytorch", |
| 206 | + "github_repo": "pytorch", |
| 207 | + "feedback_url": "https://github.com/pytorch/tutorials", |
| 208 | + "github_version": "main", |
| 209 | + "doc_path": "docs/source", |
| 210 | + "library_links": theme_variables.get("library_links", []), |
| 211 | + "icon_links": theme_variables.get("icon_links", []), |
| 212 | + "community_links": theme_variables.get("community_links", []), |
| 213 | + "pytorch_project": "docs", |
| 214 | + "language_bindings_links": html_theme_options.get("language_bindings_links", []), |
| 215 | +} |
| 216 | + |
| 217 | + |
| 218 | + |
133 | 219 | if os.getenv('GALLERY_PATTERN'):
|
134 | 220 | # GALLERY_PATTERN is to be used when you want to work on a single
|
135 | 221 | # tutorial. Previously this was fed into filename_pattern, but
|
|
0 commit comments