Skip to content

Commit

Permalink
[MRG] Bump website theme (#144)
Browse files Browse the repository at this point in the history
* bump theme and remove cruft

* update version switcher infrastructure

* add missing config var

* update stylesheet with a couple basics from MNE-Python

* CSS tweaks
  • Loading branch information
drammock authored Jul 25, 2023
1 parent 720512d commit 0b80984
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 152 deletions.
63 changes: 0 additions & 63 deletions doc/_static/js/copybutton.js

This file was deleted.

46 changes: 34 additions & 12 deletions doc/_static/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
:root {
--pst-font-family-base: 'Source Sans Pro', var(--pst-font-family-base-system);
--pst-font-family-heading: var(--pst-font-family-base);
--pst-font-family-monospace: 'Source Code Pro', var(--pst-font-family-monospace-system);
}

a[class^="sphx-glr-backref-module-mne_hfo"] {
/* make all MNE-BIDS backrefs bold */
font-weight: 800;
Expand All @@ -8,19 +14,35 @@ span.option {
white-space: nowrap;
}

/* gallery thumbnail size */
.sphx-glr-thumbcontainer {
min-width: 160px;
height: 250px;
html[data-theme="light"] {
/* sphinx-gallery overrides */
--sg-download-a-background-color: var(--pst-color-primary);
--sg-download-a-background-image: unset;
--sg-download-a-border-color: var(--pst-color-border);
--sg-download-a-color: #fff;
--sg-download-a-hover-background-color: var(--pst-color-primary-highlight);
--sg-download-a-hover-box-shadow-1: none;
--sg-download-a-hover-box-shadow-2: none;
}

/* ************************************************* Previous / Next buttons */
.prev-next-bottom a.left-prev:before {
content:"❮\00A0"
html[data-theme="dark"] {
/* sphinx-gallery overrides */
--sg-download-a-background-color: var(--pst-color-primary);
--sg-download-a-background-image: unset;
--sg-download-a-border-color: var(--pst-color-border);
--sg-download-a-color: #000;
--sg-download-a-hover-background-color: var(--pst-color-primary-highlight);
--sg-download-a-hover-box-shadow-1: none;
--sg-download-a-hover-box-shadow-2: none;
}
.prev-next-bottom a.right-next:after {
content:"\00A0❯"

/* script/notebook download buttons */
div.sphx-glr-download a {
border-radius: 0.5rem;
/* ↓↓↓↓↓↓↓ these two rules copied from sphinx-design */
box-shadow: 0 .125rem .25rem var(--sd-color-shadow) !important;
transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}
.prev-next-bottom a.right-next {
text-align: right;

div.sphx-glr-download a code {
color: var(--sg-download-a-color);
}
32 changes: 32 additions & 0 deletions doc/_static/versions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[
{
"name": "0.6 (devel)",
"version": "dev",
"url": "https://mne.tools/mne-connectivity/dev/"
},
{
"name": "0.5 (stable)",
"version": "0.5",
"url": "https://mne.tools/mne-connectivity/stable/"
},
{
"name": "0.4",
"version": "0.4",
"url": "https://mne.tools/mne-connectivity/v0.4/"
},
{
"name": "0.3",
"version": "0.3",
"url": "https://mne.tools/mne-connectivity/v0.3/"
},
{
"name": "0.2",
"version": "0.2",
"url": "https://mne.tools/mne-connectivity/v0.2/"
},
{
"name": "0.1",
"version": "0.1",
"url": "https://mne.tools/mne-connectivity/v0.1/"
}
]
20 changes: 0 additions & 20 deletions doc/_templates/docs-navbar.html

This file was deleted.

19 changes: 0 additions & 19 deletions doc/_templates/layout.html

This file was deleted.

11 changes: 0 additions & 11 deletions doc/_templates/version-switcher.html

This file was deleted.

40 changes: 15 additions & 25 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
'sphinx_copybutton',
]

# configure sphinx-issues
issues_github_path = "mne-tools/mne-connectivity"

# configure sphinx-copybutton
copybutton_prompt_text = r">>> |\.\.\. |\$ "
copybutton_prompt_is_regexp = True
Expand Down Expand Up @@ -151,21 +154,20 @@
master_doc = 'index'

# General information about the project.
project = u'MNE-Connectivity'
project = 'MNE-Connectivity'
td = date.today()
copyright = u'2021-%s, MNE Developers. Last updated on %s' % (td.year,
td.isoformat())
copyright = '2021-%s, MNE Developers. Last updated on %s' % (td.year,
td.isoformat())

author = u'Adam Li'
author = 'Adam Li'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = mne_connectivity.__version__
# The full version, including alpha/beta/rc tags.
release = version
release = mne_connectivity.__version__
# The short X.Y version.
version = ".".join(release.split(".")[:2])

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand All @@ -185,6 +187,8 @@
html_static_path = ['_static']
html_css_files = ['style.css']

switcher_version_match = "dev" if "dev" in release else version

# 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.
Expand All @@ -198,25 +202,11 @@
'navigation_with_keys': False,
'show_toc_level': 1,
'navbar_end': ['theme-switcher', 'version-switcher', 'navbar-icon-links'],
}
# Custom sidebar templates, maps document names to template names.
html_sidebars = {
'index': ['search-field.html'],
}

html_context = {
'versions_dropdown': {
'dev': 'v0.6 (devel)',
'stable': 'v0.5 (stable)',
'v0.4': 'v0.4',
'v0.3': 'v0.3',
'v0.2': 'v0.2',
'v0.1': 'v0.1',
"switcher": {
"json_url": "https://mne.tools/mne-connectivity/dev/_static/versions.json",
"version_match": switcher_version_match,
},
}

# html_sidebars = {'**': ['localtoc.html']}

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
'python': ('https://docs.python.org/3', None),
Expand Down
3 changes: 1 addition & 2 deletions requirements_doc.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
memory_profiler
sphinx<6.0
sphinx-gallery
sphinx_rtd_theme
sphinx-copybutton
sphinx-issues
numpydoc
nibabel
nilearn
pydata_sphinx_theme==0.13.1
pydata_sphinx_theme==0.13.3
typing-extensions
sphinx-autodoc-typehints
sphinxcontrib-bibtex
Expand Down

0 comments on commit 0b80984

Please sign in to comment.