99from typing import Callable
1010from typing import Protocol
1111
12+ import pytorch_sphinx_theme2 # pyright: ignore[reportMissingImports]
13+
1214# -- Path setup --------------------------------------------------------------
1315
1416
@@ -22,7 +24,7 @@ def connect(self, event: str, callback: Callable[..., None]) -> None:
2224
2325# If extensions (or modules to document with autodoc) are in another directory,
2426# add these directories to sys.path here.
25- sys .path .insert (0 , os .path .abspath (".. " ))
27+ sys .path .insert (0 , os .path .abspath ("." ))
2628
2729# -- Project information -----------------------------------------------------
2830
@@ -39,6 +41,11 @@ def connect(self, event: str, callback: Callable[..., None]) -> None:
3941 "myst_parser" ,
4042 "sphinx_autodoc_typehints" ,
4143 "sphinx_gallery.gen_gallery" ,
44+ "sphinx_design" ,
45+ "sphinx_sitemap" ,
46+ "sphinxcontrib.mermaid" ,
47+ "pytorch_sphinx_theme2" ,
48+ "sphinxext.opengraph" ,
4249]
4350
4451# MyST parser configuration
@@ -81,7 +88,83 @@ def connect(self, event: str, callback: Callable[..., None]) -> None:
8188
8289# -- Options for HTML output -------------------------------------------------
8390
84- html_theme = "sphinx_rtd_theme"
91+ html_theme = "pytorch_sphinx_theme2"
92+ html_theme_path = [pytorch_sphinx_theme2 .get_html_theme_path ()]
93+
94+ html_theme_options = {
95+ "navigation_with_keys" : False ,
96+ "analytics_id" : "GTM-T8XT4PS" ,
97+ "show_lf_header" : False ,
98+ "show_lf_footer" : False ,
99+ "logo" : {
100+ "text" : "" ,
101+ "image_light" : "_static/helion_logo.png" ,
102+ "image_dark" : "_static/helion_logo.png" ,
103+ },
104+ "icon_links" : [
105+ {
106+ "name" : "X" ,
107+ "url" : "https://x.com/PyTorch" ,
108+ "icon" : "fa-brands fa-x-twitter" ,
109+ },
110+ {
111+ "name" : "GitHub" ,
112+ "url" : "https://github.com/pytorch/helion" ,
113+ "icon" : "fa-brands fa-github" ,
114+ },
115+ {
116+ "name" : "Discourse" ,
117+ "url" : "https://dev-discuss.pytorch.org/" ,
118+ "icon" : "fa-brands fa-discourse" ,
119+ },
120+ {
121+ "name" : "PyPi" ,
122+ "url" : "https://pypi.org/project/helion" ,
123+ "icon" : "fa-brands fa-python" ,
124+ },
125+ ],
126+ "use_edit_page_button" : True ,
127+ "navbar_center" : "navbar-nav" ,
128+ }
129+
130+ theme_variables = pytorch_sphinx_theme2 .get_theme_variables ()
131+ templates_path = [
132+ "_templates" ,
133+ os .path .join (os .path .dirname (pytorch_sphinx_theme2 .__file__ ), "templates" ),
134+ ]
135+
136+ html_context = {
137+ "theme_variables" : theme_variables ,
138+ "display_github" : True ,
139+ "github_url" : "https://github.com" ,
140+ "github_user" : "pytorch" ,
141+ "github_repo" : "helion" ,
142+ "feedback_url" : "https://github.com/pytorch/helion" ,
143+ "github_version" : "main" ,
144+ "doc_path" : "docs/" ,
145+ "library_links" : [
146+ {
147+ "name" : "Helion" ,
148+ "url" : "https://pytorch.github.io/helion/" ,
149+ "current" : True ,
150+ },
151+ {
152+ "name" : "torch.compiler" ,
153+ "url" : "https://pytorch.org/docs/stable/torch.compiler.html" ,
154+ },
155+ {
156+ "name" : "PyTorch" ,
157+ "url" : "https://pytorch.org/docs/stable/" ,
158+ },
159+ {
160+ "name" : "Triton" ,
161+ "url" : "https://triton-lang.org/main/" ,
162+ },
163+ ],
164+ "community_links" : theme_variables .get ("community_links" , []),
165+ "language_bindings_links" : html_theme_options .get ("language_bindings_links" , []),
166+ }
167+
85168html_static_path = ["_static" ]
86169
87170# Output directory for HTML files
0 commit comments