Skip to content

Commit 4a4957a

Browse files
committed
Updating conf.py.
1 parent 34c28a5 commit 4a4957a

File tree

1 file changed

+62
-6
lines changed

1 file changed

+62
-6
lines changed

docs/source/conf.py

Lines changed: 62 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import sys
2525
from typing import Any
2626

27-
import pytorch_sphinx_theme
27+
import pytorch_sphinx_theme2
2828

2929
# To let us import ./custom_directives.py
3030
sys.path.insert(0, os.path.abspath("."))
@@ -63,6 +63,11 @@
6363
"sphinx_design",
6464
"sphinx_gallery.gen_gallery",
6565
"sphinx_reredirects",
66+
"sphinx_design",
67+
"sphinx_sitemap",
68+
"sphinxcontrib.mermaid",
69+
"pytorch_sphinx_theme2",
70+
"sphinxext.opengraph",
6671
]
6772

6873
if not FBCODE:
@@ -107,6 +112,8 @@
107112

108113
myst_enable_extensions = [
109114
"colon_fence",
115+
"deflist",
116+
"html_image",
110117
]
111118

112119
myst_heading_anchors = 4
@@ -162,8 +169,8 @@
162169
# The theme to use for HTML and HTML Help pages. See the documentation for
163170
# a list of builtin themes.
164171
#
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()]
167174

168175
# Theme options are theme-specific and customize the look and feel of a theme
169176
# further. For a list of options available for each theme, see the
@@ -178,17 +185,66 @@
178185
"navigation_depth": 4,
179186
"includehidden": True,
180187
"titles_only": False,
188+
"navigation_with_keys": False,
181189
"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", []),
182237
}
183238

239+
240+
ogp_site_url = "http://pytorch.org/excutorch"
241+
ogp_image = "https://pytorch.org/assets/images/social-share.jpg"
242+
184243
# Add any paths that contain custom static files (such as style sheets) here,
185244
# relative to this directory. They are copied after the builtin static files,
186245
# so a file named "default.css" will overwrite the builtin "default.css".
187246
html_static_path = ["_static"]
188247

189-
html_css_files = ["css/custom.css", "progress-bar.css"]
190-
html_js_files = ["js/progress-bar.js"]
191-
192248
# Example configuration for intersphinx: refer to the Python standard library.
193249
intersphinx_mapping = {
194250
"python": ("https://docs.python.org/", None),

0 commit comments

Comments
 (0)