| 1 |
"""Configuration file for the Sphinx documentation builder.""" |
| 2 |
|
| 3 |
import os |
| 4 |
|
| 5 |
project = "Sphinx Design" |
| 6 |
copyright = "2021, Executable Book Project" |
| 7 |
author = "Executable Book Project" |
| 8 |
|
| 9 |
extensions = ["myst_parser", "sphinx_design", "sphinx.ext.extlinks"] |
| 10 |
|
| 11 |
suppress_warnings = ["design.fa-build"] |
| 12 |
sd_fontawesome_latex = True |
| 13 |
sd_custom_directives = { |
| 14 |
"dropdown-syntax": { |
| 15 |
"inherit": "dropdown", |
| 16 |
"argument": "Syntax", |
| 17 |
"options": { |
| 18 |
"color": "primary", |
| 19 |
"icon": "code", |
| 20 |
}, |
| 21 |
} |
| 22 |
} |
| 23 |
|
| 24 |
extlinks = { |
| 25 |
"pr": ("https://github.com/executablebooks/sphinx-design/pull/%s", "PR #%s"), |
| 26 |
"user": ("https://github.com/%s", "@%s"), |
| 27 |
} |
| 28 |
|
| 29 |
html_theme = os.environ.get("SPHINX_THEME", "alabaster") |
| 30 |
html_title = f"Sphinx Design ({html_theme.replace('_', '-')})" |
| 31 |
|
| 32 |
html_static_path = ["_static"] |
| 33 |
html_logo = "_static/logo_wide.svg" |
| 34 |
html_favicon = "_static/logo_square.svg" |
| 35 |
|
| 36 |
if html_theme not in ("sphinx_book_theme", "pydata_sphinx_theme"): |
| 37 |
html_css_files = [ |
| 38 |
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" |
| 39 |
] |
| 40 |
if html_theme == "alabaster": |
| 41 |
html_logo = "" |
| 42 |
html_theme_options = { |
| 43 |
"logo": "logo_wide.svg", |
| 44 |
"logo_name": False, |
| 45 |
"description": "(alabaster theme)", |
| 46 |
"github_button": False, |
| 47 |
"github_type": "star", |
| 48 |
"github_banner": False, |
| 49 |
"github_user": "executablebooks", |
| 50 |
"github_repo": "sphinx-design", |
| 51 |
} |
| 52 |
if html_theme == "sphinx_book_theme": |
| 53 |
html_theme_options = { |
| 54 |
"repository_url": "https://github.com/executablebooks/sphinx-design", |
| 55 |
"use_repository_button": True, |
| 56 |
"use_edit_page_button": True, |
| 57 |
"use_issues_button": True, |
| 58 |
"repository_branch": "main", |
| 59 |
"path_to_docs": "docs", |
| 60 |
"home_page_in_toc": False, |
| 61 |
} |
| 62 |
if html_theme == "furo": |
| 63 |
html_css_files = [ |
| 64 |
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/fontawesome.min.css", |
| 65 |
"furo.css", |
| 66 |
] |
| 67 |
html_theme_options = { |
| 68 |
"sidebar_hide_name": True, |
| 69 |
} |
| 70 |
if html_theme == "sphinx_rtd_theme": |
| 71 |
html_theme_options = { |
| 72 |
"logo_only": True, |
| 73 |
} |
| 74 |
if html_theme == "sphinx_immaterial": |
| 75 |
extensions.append("sphinx_immaterial") |
| 76 |
html_css_files = ["sphinx_immaterial.css"] |
| 77 |
html_theme_options = { |
| 78 |
"icon": { |
| 79 |
"repo": "fontawesome/brands/github", |
| 80 |
}, |
| 81 |
"site_url": "https://sphinx-design.readthedocs.io/", |
| 82 |
"repo_url": "https://github.com/executablebooks/sphinx-design", |
| 83 |
"repo_name": "Sphinx-Design", |
| 84 |
"palette": [ |
| 85 |
{ |
| 86 |
"media": "(prefers-color-scheme: light)", |
| 87 |
"scheme": "default", |
| 88 |
"primary": "blue", |
| 89 |
"accent": "light-blue", |
| 90 |
"toggle": { |
| 91 |
"icon": "material/weather-night", |
| 92 |
"name": "Switch to dark mode", |
| 93 |
}, |
| 94 |
}, |
| 95 |
{ |
| 96 |
"media": "(prefers-color-scheme: dark)", |
| 97 |
"scheme": "slate", |
| 98 |
"primary": "blue", |
| 99 |
"accent": "yellow", |
| 100 |
"toggle": { |
| 101 |
"icon": "material/weather-sunny", |
| 102 |
"name": "Switch to light mode", |
| 103 |
}, |
| 104 |
}, |
| 105 |
], |
| 106 |
} |
| 107 |
|
| 108 |
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] |
| 109 |
myst_enable_extensions = [ |
| 110 |
"attrs_inline", |
| 111 |
"colon_fence", |
| 112 |
"deflist", |
| 113 |
"substitution", |
| 114 |
"html_image", |
| 115 |
] |
| 116 |
|
| 117 |
myst_substitutions = { |
| 118 |
"loremipsum": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. " |
| 119 |
"Sed iaculis arcu vitae odio gravida congue. Donec porttitor ac risus et condimentum. " |
| 120 |
"Phasellus bibendum ac risus a sollicitudin. " |
| 121 |
"Proin pulvinar risus ac mauris aliquet fermentum et varius nisi. " |
| 122 |
"Etiam sit amet metus ac ipsum placerat congue semper non diam. " |
| 123 |
"Nunc luctus tincidunt ipsum id eleifend. Ut sed faucibus ipsum. " |
| 124 |
"Aliquam maximus dictum posuere. Nunc vitae libero nec enim tempus euismod. " |
| 125 |
"Aliquam sed lectus ac nisl sollicitudin ultricies id at neque. " |
| 126 |
"Aliquam fringilla odio vitae lorem ornare, sit amet scelerisque orci fringilla. " |
| 127 |
"Nam sed arcu dignissim, ultrices quam sit amet, commodo ipsum. " |
| 128 |
"Etiam quis nunc at ligula tincidunt eleifend." |
| 129 |
} |