Skip to content

try out new theme #2899

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 8 additions & 27 deletions docs/_static/custom.css
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
@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');

body {
font-family: 'Open Sans', sans-serif;
}

pre, code {
font-size: 100%;
line-height: 155%;
}

/* Style the active version button.

- dev: orange
Expand Down Expand Up @@ -66,8 +55,8 @@ Nat Methods 8, 441 (2011). https://doi.org/10.1038/nmeth.1618

.sd-card .sd-card-header {
border: none;
background-color: white;
font-size: var(--pst-font-size-h5);
background-color: var(--md-default-bg-color);
font-size: 1.5rem;
font-weight: bold;
padding: 2.5rem 0rem 0.5rem 0rem;
}
Expand All @@ -84,27 +73,19 @@ Nat Methods 8, 441 (2011). https://doi.org/10.1038/nmeth.1618
}

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

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

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

html[data-theme=dark] .sd-card .sd-card-header {
background-color:var(--pst-color-background);
}

html[data-theme=dark] .sd-card .sd-card-footer {
background-color:var(--pst-color-background);
}

html[data-theme=dark] h1 {
color: var(--pst-color-primary);
body[data-md-color-scheme=slate] .sd-card .sd-card-footer {
background-color:var(--md-default-bg-color);
}
6 changes: 6 additions & 0 deletions docs/_templates/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{% extends "!base.html" %}
{% block announce %}
<p>
Zarr-Python 3 is here! Check out the release announcement <a href='https://zarr.dev/blog/zarr-python-3-release/'>here.</a>
</p>
{% endblock %}
91 changes: 74 additions & 17 deletions docs/conf.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
# zarr documentation build configuration file, created by
# sphinx-quickstart on Mon May 2 21:40:09 2016.
#
Expand Down Expand Up @@ -40,12 +38,13 @@
"sphinx.ext.autosummary",
"sphinx.ext.viewcode",
"sphinx.ext.intersphinx",
'autoapi.extension',
"numpydoc",
"autoapi.extension",
"sphinx.ext.napoleon",
"sphinx_issues",
"sphinx_copybutton",
"sphinx_design",
'sphinx_reredirects',
"sphinx_immaterial",
"sphinx_immaterial.apidoc.format_signatures",
"sphinx_reredirects",
]

issues_github_path = "zarr-developers/zarr-python"
Expand Down Expand Up @@ -158,27 +157,82 @@ def skip_submodules(

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = "pydata_sphinx_theme"
html_theme = "sphinx_immaterial"

html_favicon = "_static/logo1.png"

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
html_theme_options = {
"github_url": "https://github.com/zarr-developers/zarr-python",
"twitter_url": "https://twitter.com/zarr_dev",
"icon_links": [
"repo_url": "https://github.com/zarr-developers/zarr-python",
"social": [
{
"icon": "fontawesome/brands/twitter",
"link": "https://twitter.com/zarr_dev",
"name": "@zarr_dev on Twitter",
},
{
"name": "Zarr Dev",
"url": "https://zarr.dev/",
"icon": "_static/logo1.png",
"type": "local",
"icon": "simple/zulip",
"link": "https://ossci.zulipchat.com/",
"name": "Developer chat",
},
{
"icon": "fontawesome/brands/github",
"link": "https://github.com/zarr-developers/zarr-python/",
"name": "Source repository",
},
],
"collapse_navigation": True,
# "icon_links": [
# {
# "name": "Zarr Dev",
# "url": "https://zarr.dev/",
# "icon": "_static/logo1.png",
# "type": "local",
# },
# ],
# "collapse_navigation": True,
"navigation_with_keys": False,
"announcement": "Zarr-Python 3 is here! Check out the release announcement <a href='https://zarr.dev/blog/zarr-python-3-release/'>here.</a>",
"features": [
"navigation.expand",
"navigation.tabs",
"navigation.tabs.sticky",
"navigation.top",
"toc.sticky",
"toc.follow",
"announce.dismiss",
"content.action.view",
"navigation.footer",
],
"palette": [
{
"media": "(prefers-color-scheme)",
"toggle": {
"icon": "material/brightness-auto",
"name": "Switch to light mode",
},
},
{
"media": "(prefers-color-scheme: light)",
"scheme": "default",
"primary": "indigo",
"accent": "indigo",
"toggle": {
"icon": "material/lightbulb",
"name": "Switch to dark mode",
},
},
{
"media": "(prefers-color-scheme: dark)",
"scheme": "slate",
"primary": "black",
"accent": "blue",
"toggle": {
"icon": "material/lightbulb-outline",
"name": "Switch to system preference",
},
},
],
}

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

maximum_signature_line_length = 80
object_description_options = [
("py:.*", dict(black_format_style={}, include_fields_in_toc=False)),
("py:(parameter|typeParameter)", dict(include_in_toc=False)),
]

# -- Options for LaTeX output ---------------------------------------------

Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Zarr-Python
release-notes
developers/index
about
zarr.dev <https://zarr.dev>

**Version**: |version|

Expand Down
4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,8 @@ docs = [
'sphinx-autoapi==3.4.0',
'sphinx_design',
'sphinx-issues',
'sphinx-copybutton',
'sphinx-reredirects',
'pydata-sphinx-theme',
'numpydoc',
'sphinx_immaterial[black]>=0.13.2',
# Changelog generation
'towncrier',
# Optional dependencies to run examples
Expand Down
Loading