Skip to content

Commit f9d4ddf

Browse files
authored
Merge pull request #1 from jbms/new-theme
Improve integration with sphinx-immaterial theme
2 parents 8b70e39 + 13d1b4c commit f9d4ddf

File tree

5 files changed

+82
-41
lines changed

5 files changed

+82
-41
lines changed

docs/_static/custom.css

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
1-
@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,400;0,700;0,900;1,400;1,700;1,900&family=Open+Sans:ital,wght@0,400;0,600;1,400;1,600&display=swap');
2-
3-
body {
4-
font-family: 'Open Sans', sans-serif;
5-
}
6-
7-
pre, code {
8-
font-size: 100%;
9-
line-height: 155%;
10-
}
11-
121
/* Style the active version button.
132
143
- dev: orange
@@ -66,8 +55,8 @@ Nat Methods 8, 441 (2011). https://doi.org/10.1038/nmeth.1618
6655

6756
.sd-card .sd-card-header {
6857
border: none;
69-
background-color: white;
70-
font-size: var(--pst-font-size-h5);
58+
background-color: var(--md-default-bg-color);
59+
font-size: 1.5rem;
7160
font-weight: bold;
7261
padding: 2.5rem 0rem 0.5rem 0rem;
7362
}
@@ -84,27 +73,19 @@ Nat Methods 8, 441 (2011). https://doi.org/10.1038/nmeth.1618
8473
}
8574

8675
/* Dark theme tweaking */
87-
html[data-theme=dark] .sd-card img[src*='.svg'] {
76+
body[data-md-color-scheme=slate] .sd-card img[src*='.svg'] {
8877
filter: invert(0.82) brightness(0.8) contrast(1.2);
8978
}
9079

9180
/* Main index page overview cards */
92-
html[data-theme=dark] .sd-card {
93-
background-color:var(--pst-color-background);
81+
body[data-md-color-scheme=slate] .sd-card {
82+
background-color:var(--md-default-bg-color);
9483
}
9584

96-
html[data-theme=dark] .sd-shadow-sm {
85+
body[data-md-color-scheme=slate] .sd-shadow-sm {
9786
box-shadow: 0 .1rem 1rem rgba(250, 250, 250, .6) !important
9887
}
9988

100-
html[data-theme=dark] .sd-card .sd-card-header {
101-
background-color:var(--pst-color-background);
102-
}
103-
104-
html[data-theme=dark] .sd-card .sd-card-footer {
105-
background-color:var(--pst-color-background);
106-
}
107-
108-
html[data-theme=dark] h1 {
109-
color: var(--pst-color-primary);
89+
body[data-md-color-scheme=slate] .sd-card .sd-card-footer {
90+
background-color:var(--md-default-bg-color);
11091
}

docs/_templates/base.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{% extends "!base.html" %}
2+
{% block announce %}
3+
<p>
4+
Zarr-Python 3 is here! Check out the release announcement <a href='https://zarr.dev/blog/zarr-python-3-release/'>here.</a>
5+
</p>
6+
{% endblock %}

docs/conf.py

100644100755
Lines changed: 66 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python3
2-
#
31
# zarr documentation build configuration file, created by
42
# sphinx-quickstart on Mon May 2 21:40:09 2016.
53
#
@@ -40,13 +38,13 @@
4038
"sphinx.ext.autosummary",
4139
"sphinx.ext.viewcode",
4240
"sphinx.ext.intersphinx",
43-
'autoapi.extension',
44-
"numpydoc",
41+
"autoapi.extension",
42+
"sphinx.ext.napoleon",
4543
"sphinx_issues",
46-
"sphinx_copybutton",
4744
"sphinx_design",
4845
"sphinx_immaterial",
49-
'sphinx_reredirects',
46+
"sphinx_immaterial.apidoc.format_signatures",
47+
"sphinx_reredirects",
5048
]
5149

5250
issues_github_path = "zarr-developers/zarr-python"
@@ -167,8 +165,24 @@ def skip_submodules(
167165
# further. For a list of options available for each theme, see the
168166
# documentation.
169167
html_theme_options = {
170-
# "github_url": "https://github.com/zarr-developers/zarr-python",
171-
# "twitter_url": "https://twitter.com/zarr_dev",
168+
"repo_url": "https://github.com/zarr-developers/zarr-python",
169+
"social": [
170+
{
171+
"icon": "fontawesome/brands/twitter",
172+
"link": "https://twitter.com/zarr_dev",
173+
"name": "@zarr_dev on Twitter",
174+
},
175+
{
176+
"icon": "simple/zulip",
177+
"link": "https://ossci.zulipchat.com/",
178+
"name": "Developer chat",
179+
},
180+
{
181+
"icon": "fontawesome/brands/github",
182+
"link": "https://github.com/zarr-developers/zarr-python/",
183+
"name": "Source repository",
184+
},
185+
],
172186
# "icon_links": [
173187
# {
174188
# "name": "Zarr Dev",
@@ -179,7 +193,46 @@ def skip_submodules(
179193
# ],
180194
# "collapse_navigation": True,
181195
"navigation_with_keys": False,
182-
# "announcement": "Zarr-Python 3 is here! Check out the release announcement <a href='https://zarr.dev/blog/zarr-python-3-release/'>here.</a>",
196+
"features": [
197+
"navigation.expand",
198+
"navigation.tabs",
199+
"navigation.tabs.sticky",
200+
"navigation.top",
201+
"toc.sticky",
202+
"toc.follow",
203+
"announce.dismiss",
204+
"content.action.view",
205+
"navigation.footer",
206+
],
207+
"palette": [
208+
{
209+
"media": "(prefers-color-scheme)",
210+
"toggle": {
211+
"icon": "material/brightness-auto",
212+
"name": "Switch to light mode",
213+
},
214+
},
215+
{
216+
"media": "(prefers-color-scheme: light)",
217+
"scheme": "default",
218+
"primary": "indigo",
219+
"accent": "indigo",
220+
"toggle": {
221+
"icon": "material/lightbulb",
222+
"name": "Switch to dark mode",
223+
},
224+
},
225+
{
226+
"media": "(prefers-color-scheme: dark)",
227+
"scheme": "slate",
228+
"primary": "black",
229+
"accent": "blue",
230+
"toggle": {
231+
"icon": "material/lightbulb-outline",
232+
"name": "Switch to system preference",
233+
},
234+
},
235+
],
183236
}
184237

185238
# Add any paths that contain custom themes here, relative to this directory.
@@ -280,7 +333,10 @@ def setup(app: sphinx.application.Sphinx) -> None:
280333
# Output file base name for HTML help builder.
281334
htmlhelp_basename = "zarrdoc"
282335

283-
maximum_signature_line_length = 80
336+
object_description_options = [
337+
("py:.*", dict(black_format_style={}, include_fields_in_toc=False)),
338+
("py:(parameter|typeParameter)", dict(include_in_toc=False)),
339+
]
284340

285341
# -- Options for LaTeX output ---------------------------------------------
286342

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Zarr-Python
1414
release-notes
1515
developers/index
1616
about
17+
zarr.dev <https://zarr.dev>
1718

1819
**Version**: |version|
1920

pyproject.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,8 @@ docs = [
9393
'sphinx-autoapi==3.4.0',
9494
'sphinx_design',
9595
'sphinx-issues',
96-
'sphinx-copybutton',
9796
'sphinx-reredirects',
98-
'pydata-sphinx-theme',
99-
'sphinx_immaterial',
100-
'numpydoc',
97+
'sphinx_immaterial>=0.13.2[black]',
10198
# Changelog generation
10299
'towncrier',
103100
# Optional dependencies to run examples

0 commit comments

Comments
 (0)