|
66 | 66 | # custom ext, see ./sphinxext/gh_substitutions.py |
67 | 67 | ] |
68 | 68 |
|
| 69 | +# set it to True to build a stable version of the documentation |
| 70 | +is_stable_doc = False |
| 71 | + |
69 | 72 | myst_enable_extensions = [ |
70 | 73 | "dollarmath", |
71 | 74 | "amsmath" |
|
76 | 79 | # Add any paths that contain templates here, relative to this directory. |
77 | 80 | templates_path = ['_templates'] |
78 | 81 |
|
| 82 | +html_css_files = ["style.css"] |
| 83 | + |
79 | 84 | # The suffix(es) of source filenames. |
80 | 85 | # You can specify multiple suffix as a list of string: |
81 | 86 | # source_suffix = ['.rst', '.md'] |
|
208 | 213 |
|
209 | 214 | # The name for this set of Sphinx documents. If None, it defaults to |
210 | 215 | # "<project> v<release> documentation". |
211 | | -#html_title = None |
| 216 | +html_title = f"skglm {version} documentation" |
212 | 217 |
|
213 | 218 | # A shorter title for the navigation bar. Default is the same as html_title. |
214 | 219 | #html_short_title = None |
|
241 | 246 | #html_use_smartypants = True |
242 | 247 |
|
243 | 248 | # Custom sidebar templates, maps document names to template names. |
244 | | -#html_sidebars = {} |
| 249 | +html_sidebars = { |
| 250 | + "**": [ |
| 251 | + "sidebar/brand.html", |
| 252 | + "sidebar/version_toggler.html", # version toggler template |
| 253 | + "sidebar/search.html", |
| 254 | + "sidebar/navigation.html", |
| 255 | + ] |
| 256 | +} |
| 257 | + |
| 258 | +# these variables will be available in the sphinx templates |
| 259 | +html_context = { |
| 260 | + "is_stable_doc": is_stable_doc |
| 261 | +} |
| 262 | + |
| 263 | + |
| 264 | +# when it's the dev version of the documentation, put a banner to warn the user |
| 265 | +# and a link to switch to the dev version of doc |
| 266 | +if not is_stable_doc: |
| 267 | + html_theme_options = { |
| 268 | + "announcement": ( |
| 269 | + "You are viewing the documentation of the dev version of " |
| 270 | + "<code>skglm</code> which contains WIP features. " |
| 271 | + "View <a href='stable/index.html'>stable version</a>." |
| 272 | + ) |
| 273 | + } |
| 274 | + |
245 | 275 |
|
246 | 276 | # Additional templates that should be rendered to pages, maps page names to |
247 | 277 | # template names. |
|
0 commit comments