|
24 | 24 | import sys |
25 | 25 | from typing import Any |
26 | 26 |
|
27 | | -import pytorch_sphinx_theme |
| 27 | +import pytorch_sphinx_theme2 |
28 | 28 |
|
29 | 29 | # To let us import ./custom_directives.py |
30 | 30 | sys.path.insert(0, os.path.abspath(".")) |
|
63 | 63 | "sphinx_design", |
64 | 64 | "sphinx_gallery.gen_gallery", |
65 | 65 | "sphinx_reredirects", |
| 66 | + "sphinx_design", |
| 67 | + "sphinx_sitemap", |
| 68 | + "sphinxcontrib.mermaid", |
| 69 | + "pytorch_sphinx_theme2", |
| 70 | + "sphinxext.opengraph", |
66 | 71 | ] |
67 | 72 |
|
68 | 73 | if not FBCODE: |
|
107 | 112 |
|
108 | 113 | myst_enable_extensions = [ |
109 | 114 | "colon_fence", |
| 115 | + "deflist", |
| 116 | + "html_image", |
110 | 117 | ] |
111 | 118 |
|
112 | 119 | myst_heading_anchors = 4 |
|
162 | 169 | # The theme to use for HTML and HTML Help pages. See the documentation for |
163 | 170 | # a list of builtin themes. |
164 | 171 | # |
165 | | -html_theme = "pytorch_sphinx_theme" |
166 | | -html_theme_path = [pytorch_sphinx_theme.get_html_theme_path()] |
| 172 | +html_theme = "pytorch_sphinx_theme2" |
| 173 | +html_theme_path = [pytorch_sphinx_theme2.get_html_theme_path()] |
167 | 174 |
|
168 | 175 | # Theme options are theme-specific and customize the look and feel of a theme |
169 | 176 | # further. For a list of options available for each theme, see the |
|
178 | 185 | "navigation_depth": 4, |
179 | 186 | "includehidden": True, |
180 | 187 | "titles_only": False, |
| 188 | + "navigation_with_keys": False, |
181 | 189 | "analytics_id": "GTM-T8XT4PS", |
| 190 | + "logo": { |
| 191 | + "text": "", |
| 192 | + }, |
| 193 | + "icon_links": [ |
| 194 | + { |
| 195 | + "name": "X", |
| 196 | + "url": "https://x.com/PyTorch", |
| 197 | + "icon": "fa-brands fa-x-twitter", |
| 198 | + }, |
| 199 | + { |
| 200 | + "name": "GitHub", |
| 201 | + "url": "https://github.com/pytorch/<your-repo>", |
| 202 | + "icon": "fa-brands fa-github", |
| 203 | + }, |
| 204 | + { |
| 205 | + "name": "Discourse", |
| 206 | + "url": "https://dev-discuss.pytorch.org/", |
| 207 | + "icon": "fa-brands fa-discourse", |
| 208 | + }, |
| 209 | + { |
| 210 | + "name": "PyPi", |
| 211 | + "url": "https://pypi.org/project/<your-project>/", |
| 212 | + "icon": "fa-brands fa-python", |
| 213 | + }, |
| 214 | + ], |
| 215 | + "use_edit_page_button": True, |
| 216 | + "navbar_center": "navbar-nav", |
| 217 | +} |
| 218 | + |
| 219 | +theme_variables = pytorch_sphinx_theme2.get_theme_variables() |
| 220 | +templates_path = [ |
| 221 | + "_templates", |
| 222 | + os.path.join(os.path.dirname(pytorch_sphinx_theme2.__file__), "templates"), |
| 223 | +] |
| 224 | + |
| 225 | +html_context = { |
| 226 | + "theme_variables": theme_variables, |
| 227 | + "display_github": True, |
| 228 | + "github_url": "https://github.com", |
| 229 | + "github_user": "pytorch", |
| 230 | + "github_repo": "<your-repo>", |
| 231 | + "feedback_url": "https://github.com/pytorch/executorch/issues/new", |
| 232 | + "github_version": "main", |
| 233 | + "doc_path": "docs/source", |
| 234 | + "library_links": theme_variables.get("library_links", []), |
| 235 | + "community_links": theme_variables.get("community_links", []), |
| 236 | + "language_bindings_links": html_theme_options.get("language_bindings_links", []), |
182 | 237 | } |
183 | 238 |
|
| 239 | + |
| 240 | +ogp_site_url = "http://pytorch.org/excutorch" |
| 241 | +ogp_image = "https://pytorch.org/assets/images/social-share.jpg" |
| 242 | + |
184 | 243 | # Add any paths that contain custom static files (such as style sheets) here, |
185 | 244 | # relative to this directory. They are copied after the builtin static files, |
186 | 245 | # so a file named "default.css" will overwrite the builtin "default.css". |
187 | 246 | html_static_path = ["_static"] |
188 | 247 |
|
189 | | -html_css_files = ["css/custom.css", "progress-bar.css"] |
190 | | -html_js_files = ["js/progress-bar.js"] |
191 | | - |
192 | 248 | # Example configuration for intersphinx: refer to the Python standard library. |
193 | 249 | intersphinx_mapping = { |
194 | 250 | "python": ("https://docs.python.org/", None), |
|
0 commit comments