|
17 | 17 | import os
|
18 | 18 | from os.path import dirname, join
|
19 | 19 | import sys
|
| 20 | +from jinja2 import FileSystemLoader, Environment |
20 | 21 |
|
21 | 22 | import yaml
|
22 | 23 | from numpydoc.xref import DEFAULT_LINKS
|
23 | 24 |
|
24 |
| -import sphinx_material |
25 | 25 | from statsmodels import __version__
|
26 | 26 |
|
27 | 27 | # -- Monkey Patch ----------------------------------------------------------
|
|
56 | 56 | 'matplotlib.sphinxext.plot_directive',
|
57 | 57 | 'IPython.sphinxext.ipython_console_highlighting',
|
58 | 58 | 'IPython.sphinxext.ipython_directive',
|
| 59 | + "sphinx_immaterial", |
59 | 60 | ]
|
60 | 61 |
|
61 | 62 | try:
|
|
162 | 163 |
|
163 | 164 | # The theme to use for HTML and HTML Help pages. See the documentation for
|
164 | 165 | # a list of builtin themes.
|
165 |
| -extensions.append('sphinx_material') |
166 |
| -html_theme_path = sphinx_material.html_theme_path() |
167 |
| -html_context = sphinx_material.get_html_context() |
168 |
| -html_theme = 'sphinx_material' |
| 166 | + |
| 167 | +html_theme = 'sphinx_immaterial' |
169 | 168 | html_title = project
|
170 | 169 | html_short_title = project
|
171 | 170 | # material theme options (see theme.conf for more information)
|
172 | 171 |
|
173 |
| -base_url = 'https://statsmodels.org/' |
174 |
| -base_url += 'stable/' if full_version == version else 'devel/' |
| 172 | +site_url = 'https://statsmodels.org/' |
| 173 | +site_url += 'stable/' if full_version == version else 'devel/' |
| 174 | + |
| 175 | +# sphinx_immaterial theme options |
175 | 176 | html_theme_options = {
|
176 |
| - 'base_url': base_url, |
177 |
| - 'repo_url': 'https://github.com/statsmodels/statsmodels', |
178 |
| - 'repo_name': 'statsmodels', |
179 |
| - 'globaltoc_depth': 3, |
180 |
| - 'globaltoc_collapse': True, |
181 |
| - 'globaltoc_includehidden': True, |
182 |
| - 'color_primary': 'indigo', |
183 |
| - 'color_accent': 'blue', |
184 |
| - 'nav_title': 'statsmodels {0}'.format(version), |
185 |
| - 'master_doc': False, |
186 |
| - 'nav_links': [], |
187 |
| - 'heroes': {'index': 'statistical models, hypothesis tests, and data ' |
188 |
| - 'exploration', |
189 |
| - 'examples/index': 'examples and tutorials to get started with ' |
190 |
| - 'statsmodels'}, |
| 177 | + "icon": {"repo": "fontawesome/brands/github"}, |
| 178 | + "site_url": site_url, |
| 179 | + "repo_url": "https://github.com/statsmodels/statsmodels/", |
| 180 | + "repo_name": "statsmodels", |
| 181 | + "repo_type": "github", |
| 182 | + "palette": {"primary": "indigo", "accent": "blue"}, |
| 183 | + "globaltoc_collapse": True, |
| 184 | + "toc_title": "Contents", |
191 | 185 | "version_dropdown": True,
|
192 |
| - "version_json": "../versions-v2.json", |
| 186 | + "version_info": [ |
| 187 | + { |
| 188 | + "version": "https://statsmodels.org/stable/", |
| 189 | + "title": "Release", |
| 190 | + "aliases": [], |
| 191 | + }, |
| 192 | + { |
| 193 | + "version": "https://statsmodels.org/devel/", |
| 194 | + "title": "Development", |
| 195 | + "aliases": [], |
| 196 | + }, |
| 197 | + { |
| 198 | + "version": "https://statsmodels.org/0.13.0/", |
| 199 | + "title": "Version v0.13.0", |
| 200 | + "aliases": [], |
| 201 | + }, |
| 202 | + { |
| 203 | + "version": "https://statsmodels.org/0.12.2/", |
| 204 | + "title": "Version v0.12.2", |
| 205 | + "aliases": [], |
| 206 | + }, |
| 207 | + { |
| 208 | + "version": "https://statsmodels.org/0.12.1/", |
| 209 | + "title": "Version v0.12.1", |
| 210 | + "aliases": [], |
| 211 | + }, |
| 212 | + { |
| 213 | + "version": "https://statsmodels.org/0.12.0/", |
| 214 | + "title": "Version v0.12.0", |
| 215 | + "aliases": [], |
| 216 | + }, |
| 217 | + { |
| 218 | + "version": "https://statsmodels.org/0.11.1/", |
| 219 | + "title": "Version v0.11.1", |
| 220 | + "aliases": [], |
| 221 | + }, |
| 222 | + { |
| 223 | + "version": "https://statsmodels.org/0.11.0/", |
| 224 | + "title": "Version v0.11.0", |
| 225 | + "aliases": [], |
| 226 | + }, |
| 227 | + { |
| 228 | + "version": "https://statsmodels.org/0.10.2/", |
| 229 | + "title": "Version v0.10.2", |
| 230 | + "aliases": [], |
| 231 | + }, |
| 232 | + { |
| 233 | + "version": "https://statsmodels.org/0.10.1/", |
| 234 | + "title": "Version v0.10.1", |
| 235 | + "aliases": [], |
| 236 | + }, |
| 237 | + { |
| 238 | + "version": "https://statsmodels.org/0.10.0/", |
| 239 | + "title": "Version v0.10.0", |
| 240 | + "aliases": [], |
| 241 | + }, |
| 242 | + |
| 243 | + { |
| 244 | + "version": "https://statsmodels.org/0.9.0/", |
| 245 | + "title": "Version 0.9.0", |
| 246 | + "aliases": [], |
| 247 | + }, |
| 248 | + |
| 249 | + { |
| 250 | + "version": "https://statsmodels.org/0.8.0/", |
| 251 | + "title": "Version 0.8.0", |
| 252 | + "aliases": [], |
| 253 | + }, |
| 254 | + { |
| 255 | + "version": "https://statsmodels.org/0.6.1/", |
| 256 | + "title": "Version 0.6.1", |
| 257 | + "aliases": [], |
| 258 | + }, |
| 259 | + |
| 260 | + ], |
| 261 | + "toc_title_is_page_title": True, |
| 262 | + "social": [ |
| 263 | + { |
| 264 | + "icon": "fontawesome/brands/github", |
| 265 | + "link": "https://github.com/statsmodels/statsmodels/", |
| 266 | + "name": "Source on github.com", |
| 267 | + }, |
| 268 | + { |
| 269 | + "icon": "fontawesome/brands/python", |
| 270 | + "link": "https://pypi.org/project/statsmodels/", |
| 271 | + }, |
| 272 | + { |
| 273 | + "icon": "fontawesome/solid/quote-left", |
| 274 | + "link": "https://doi.org/10.5281/zenodo.593847", |
| 275 | + }, |
| 276 | + ], |
193 | 277 | }
|
194 | 278 |
|
195 | 279 | language = 'en'
|
|
406 | 490 | github_project_url = 'https://github.com/statsmodels/statsmodels'
|
407 | 491 |
|
408 | 492 | example_context = yaml.safe_load(open('examples/landing.yml', encoding="utf-8"))
|
409 |
| -html_context.update({'examples': example_context}) |
| 493 | + |
| 494 | +example_loader = FileSystemLoader("examples") |
| 495 | +example_env = Environment(loader=example_loader) |
| 496 | +example_tmpl = example_env.get_template("index.jinja2") |
| 497 | +with open("examples/index.rst", "w") as example_index: |
| 498 | + example_index.write(example_tmpl.render(examples=example_context)) |
| 499 | + |
| 500 | +# html_context.update({'examples': example_context}) |
410 | 501 |
|
411 | 502 | # --------------- DOCTEST -------------------
|
412 | 503 | doctest_global_setup = """
|
|
0 commit comments