diff --git a/docs/_static/custom.css b/docs/_static/custom.css index 1d32606f9a..0f8ae4ec35 100644 --- a/docs/_static/custom.css +++ b/docs/_static/custom.css @@ -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 @@ -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; } @@ -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); } diff --git a/docs/_templates/base.html b/docs/_templates/base.html new file mode 100644 index 0000000000..6bc156f1c3 --- /dev/null +++ b/docs/_templates/base.html @@ -0,0 +1,6 @@ +{% extends "!base.html" %} +{% block announce %} +

+ Zarr-Python 3 is here! Check out the release announcement here. +

+{% endblock %} diff --git a/docs/conf.py b/docs/conf.py old mode 100644 new mode 100755 index d69309d432..c643b39004 --- a/docs/conf.py +++ b/docs/conf.py @@ -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. # @@ -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" @@ -158,7 +157,7 @@ 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" @@ -166,19 +165,74 @@ def skip_submodules( # 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 here.", + "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. @@ -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 --------------------------------------------- diff --git a/docs/index.rst b/docs/index.rst index 83d427e290..0effe65a2f 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -14,6 +14,7 @@ Zarr-Python release-notes developers/index about + zarr.dev **Version**: |version| diff --git a/pyproject.toml b/pyproject.toml index 0137927039..3bb448253c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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