Skip to content

Commit 5579e78

Browse files
authored
Update to pydata-sphinx-theme==0.8.1 (#33)
* add in additional pre-commit hooks * remove unneeded CSS config
1 parent c6d6f73 commit 5579e78

File tree

4 files changed

+28
-105
lines changed

4 files changed

+28
-105
lines changed

.pre-commit-config.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,17 @@ repos:
3030
hooks:
3131
- id: pydocstyle
3232
additional_dependencies: [toml]
33+
34+
- repo: https://github.com/pre-commit/pre-commit-hooks
35+
rev: v4.1.0
36+
hooks:
37+
- id: check-merge-conflict
38+
- id: debug-statements
39+
- id: no-commit-to-branch
40+
args: [--branch, main]
41+
42+
# this validates our github workflow files
43+
- repo: https://github.com/python-jsonschema/check-jsonschema
44+
rev: 0.14.0
45+
hooks:
46+
- id: check-github-workflows

pyansys_sphinx_theme/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ def setup(app):
2929
"""Connect to the sphinx theme app."""
3030
theme_path = get_html_theme_path()[0]
3131
app.add_html_theme("pyansys_sphinx_theme", theme_path)
32+
theme_css_path = os.path.join(
33+
theme_path, "static", "css", "pyansys_sphinx_theme.css"
34+
)
35+
if not os.path.isfile(theme_css_path):
36+
raise FileNotFoundError(
37+
f"Unable to locate pyansys-sphinx theme at {theme_css_path}"
38+
)
39+
app.add_css_file(theme_css_path)
3240

3341
# add templates for autosummary
3442
path_templates = os.path.join(_this_path, "_templates")

pyansys_sphinx_theme/static/css/theme.css renamed to pyansys_sphinx_theme/static/css/pyansys_sphinx_theme.css

Lines changed: 6 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -14,38 +14,10 @@
1414
}
1515

1616
:root {
17-
/* Ansys colors */
18-
--ansysGold: 255, 183, 27; /* #FFB71B */
19-
--ansysBronze: 200, 146, 17; /* #C89211 */
20-
--pythonBlue: 57, 114, 161; /* #3972a1 */
21-
22-
23-
/*****************************************************************************
24-
* Theme config
25-
**/
26-
--pst-header-height: 60px;
27-
28-
/*****************************************************************************
29-
* Font size
30-
**/
31-
--pst-font-size-base: 15px; /* base font size - applied at body / html level */
32-
33-
/* heading font sizes */
34-
--pst-font-size-h1: 36px;
35-
--pst-font-size-h2: 32px;
36-
--pst-font-size-h3: 26px;
37-
--pst-font-size-h4: 21px;
38-
--pst-font-size-h5: 18px;
39-
--pst-font-size-h6: 16px;
40-
41-
/* smaller then heading font sizes*/
42-
--pst-font-size-milli: 12px;
43-
44-
--pst-sidebar-font-size: .9em;
45-
--pst-sidebar-caption-font-size: .9em;
17+
/* Ansys specific changes to the theme */
4618

4719
/*****************************************************************************
48-
* Font family
20+
* Ansys Font family
4921
**/
5022
/* These are adapted from https://systemfontstack.com/ */
5123
--pst-font-family-base-system: -apple-system, BlinkMacSystemFont, Segoe UI, "Helvetica Neue",
@@ -57,89 +29,20 @@
5729
--pst-font-family-heading: 'Source Sans Pro', sans-serif, var(--pst-font-family-base-system);
5830
--pst-font-family-monospace: Courier, var(--pst-font-family-monospace-system);
5931

60-
/* --pst-font-family-base: var(--pst-font-family-base-system); */
61-
/* --pst-font-family-heading: var(--pst-font-family-base); */
62-
/* --pst-font-family-monospace: var(--pst-font-family-monospace-system); */
63-
6432
/*****************************************************************************
65-
* Color
33+
* Ansys compatible colors
6634
*
6735
* Colors are defined in rgb string way, "red, green, blue"
6836
**/
69-
--pst-color-primary: 19, 6, 84;
70-
--pst-color-success: 40, 167, 69;
71-
--pst-color-info: 0, 123, 255; /*23, 162, 184;*/
72-
--pst-color-warning: 255, 193, 7;
73-
--pst-color-danger: 220, 53, 69;
74-
--pst-color-text-base: 51, 51, 51;
75-
76-
--pst-color-h1: 57, 114, 161; /*pythonBlue*/
77-
--pst-color-h2: 57, 114, 161; /*pythonBlue*/
78-
--pst-color-h3: 57, 114, 161; /*pythonBlue*/
79-
--pst-color-h4: 57, 114, 161; /*pythonBlue*/
80-
--pst-color-h5: 57, 114, 161; /*pythonBlue*/
81-
--pst-color-h6: 57, 114, 161; /*pythonBlue*/
82-
--pst-color-paragraph: var(--pst-color-text-base);
83-
--pst-color-link: 0, 91, 129;
84-
--pst-color-link-hover: 227, 46, 0;
85-
--pst-color-headerlink: 198, 15, 15;
86-
--pst-color-headerlink-hover: 255, 255, 255;
87-
--pst-color-preformatted-text: 34, 34, 34;
88-
--pst-color-preformatted-background: 250, 250, 250;
89-
--pst-color-inline-code: 232, 62, 140;
37+
--ansysGold: 255, 183, 27; /* #FFB71B */
38+
--ansysBronze: 200, 146, 17; /* #C89211 */
39+
--pythonBlue: 57, 114, 161; /* #3972a1 */
9040

9141
--pst-color-active-navigation: 200, 146, 17; /* --ansysBronze */
9242
--pst-color-navbar-link: 255, 255, 255;
9343
--pst-color-navbar-link-hover: 255, 183, 27; /* --ansysBronze */
9444
--pst-color-navbar-link-active: 255, 183, 27; /* --ansysBronze */
9545

96-
--pst-color-sidebar-link: 77, 77, 77;
97-
--pst-color-sidebar-link-hover: var(--pst-color-active-navigation);
98-
--pst-color-sidebar-link-active: var(--pst-color-active-navigation);
99-
--pst-color-sidebar-expander-background-hover: 255, 183, 27; /* --ansysGold */
100-
--pst-color-sidebar-caption: 77, 77, 77;
101-
--pst-color-toc-link: 119, 117, 122;
102-
--pst-color-toc-link-hover: var(--pst-color-active-navigation);
103-
--pst-color-toc-link-active: var(--pst-color-active-navigation);
104-
105-
/*****************************************************************************
106-
* Icon
107-
**/
108-
109-
/* font awesome icons*/
110-
--pst-icon-check-circle: '\f058';
111-
--pst-icon-info-circle: '\f05a';
112-
--pst-icon-exclamation-triangle: '\f071';
113-
--pst-icon-exclamation-circle: '\f06a';
114-
--pst-icon-times-circle: '\f057';
115-
--pst-icon-lightbulb: '\f0eb';
116-
117-
/*****************************************************************************
118-
* Admonitions
119-
**/
120-
121-
--pst-color-admonition-default: var(--pst-color-info);
122-
--pst-color-admonition-note: var(--pst-color-info);
123-
--pst-color-admonition-attention: var(--pst-color-warning);
124-
--pst-color-admonition-caution: var(--pst-color-warning);
125-
--pst-color-admonition-warning: var(--pst-color-warning);
126-
--pst-color-admonition-danger: var(--pst-color-danger);
127-
--pst-color-admonition-error: var(--pst-color-danger);
128-
--pst-color-admonition-hint: var(--pst-color-success);
129-
--pst-color-admonition-tip: var(--pst-color-success);
130-
--pst-color-admonition-important: var(--pst-color-success);
131-
132-
--pst-icon-admonition-default: var(--pst-icon-info-circle);
133-
--pst-icon-admonition-note: var(--pst-icon-info-circle);
134-
--pst-icon-admonition-attention: var(--pst-icon-exclamation-circle);
135-
--pst-icon-admonition-caution: var(--pst-icon-exclamation-triangle);
136-
--pst-icon-admonition-warning: var(--pst-icon-exclamation-triangle);
137-
--pst-icon-admonition-danger: var(--pst-icon-exclamation-triangle);
138-
--pst-icon-admonition-error: var(--pst-icon-times-circle);
139-
--pst-icon-admonition-hint: var(--pst-icon-lightbulb);
140-
--pst-icon-admonition-tip: var(--pst-icon-lightbulb);
141-
--pst-icon-admonition-important: var(--pst-icon-exclamation-circle);
142-
14346
}
14447

14548
.docutils {

pyansys_sphinx_theme/theme.conf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,5 @@ pygments_style = friendly
55
[options]
66
github_url = https://github.com/pyansys
77
logo_link = https://docs.pyansys.com/
8-
show_prev_next = False
98
show_breadcrumbs = True
109
additional_breadcrumbs =
11-
html_favicon = "ansys-favicon.png"

0 commit comments

Comments
 (0)