From 05f432bb319f0782dc0d2d37d2ccccaabcb34f14 Mon Sep 17 00:00:00 2001 From: Daniel McCloy Date: Thu, 17 Jul 2025 14:21:26 -0500 Subject: [PATCH 1/4] add GH Sponsors icon link --- doc/_static/style.css | 5 +++++ doc/conf.py | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/doc/_static/style.css b/doc/_static/style.css index 70735d9c3fb..de7d109d68a 100644 --- a/doc/_static/style.css +++ b/doc/_static/style.css @@ -31,6 +31,7 @@ html[data-theme="light"] { --mne-color-github: #000; --mne-color-discourse: #d0232b; --mne-color-mastodon: #2F0C7A; + --mne-color-sponsor: #BF3989; /* from GH sponsor heart, via browser devtools */ /* code block copy button */ --copybtn-opacity: 0.75; /* card header bg color */ @@ -63,6 +64,7 @@ html[data-theme="dark"] { --mne-color-github: rgb(240, 246, 252); /* from their logo SVG */ --mne-color-discourse: #FFF9AE; /* from their logo SVG */ --mne-color-mastodon: #858AFA; /* www.joinmastodon.org/en/branding */ + --mne-color-sponsor: #DB61A2; /* from GH sponsor heart, via browser devtools */ /* code block copy button */ --copybtn-opacity: 0.25; /* card header bg color */ @@ -265,6 +267,9 @@ aside.footnote:last-child { .navbar-icon-links svg.fa-mastodon { color: var(--mne-color-mastodon); } +.navbar-icon-links svg.fa-heart { + color: var(--mne-color-sponsor); +} /* ************************************************************ nav elements */ /* topbar nav inactive */ diff --git a/doc/conf.py b/doc/conf.py index 39ee02a6d3d..f008c696ea9 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -800,6 +800,11 @@ def fix_sklearn_inherited_docstrings(app, what, name, obj, options, lines): url="https://github.com/mne-tools/mne-python", icon="fa-brands fa-square-github fa-fw", ), + dict( + name="Sponsor on GitHub", + url="https://github.com/sponsors/mne-tools", + icon="fa-regular fa-heart fa-fw", + ), ], "icon_links_label": "External Links", # for screen reader "use_edit_page_button": False, From 2cdcc8232f04f947843bf615fcd459e4aeca4374 Mon Sep 17 00:00:00 2001 From: Daniel McCloy Date: Thu, 17 Jul 2025 14:53:07 -0500 Subject: [PATCH 2/4] add opencollective icon link --- doc/_static/js/custom-icons.js | 19 +++++++++++++++++++ doc/_static/style.css | 5 +++++ doc/conf.py | 8 ++++++++ 3 files changed, 32 insertions(+) create mode 100644 doc/_static/js/custom-icons.js diff --git a/doc/_static/js/custom-icons.js b/doc/_static/js/custom-icons.js new file mode 100644 index 00000000000..60b3c3b9276 --- /dev/null +++ b/doc/_static/js/custom-icons.js @@ -0,0 +1,19 @@ +FontAwesome.library.add( + /** + * Custom icon definitions + * + * see https://pydata-sphinx-theme.readthedocs.io/en/latest/user_guide/header-links.html#svg-image-icons + */ + { + prefix: "fa-custom", + iconName: "opencollective", + icon: [ + 24, + 24, + [], + "e001", + // https://simpleicons.org/icons/opencollective.svg + "M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12c2.54 0 4.894-.79 6.834-2.135l-3.107-3.109a7.715 7.715 0 1 1 0-13.512l3.107-3.109A11.943 11.943 0 0 0 12 0zm9.865 5.166l-3.109 3.107A7.67 7.67 0 0 1 19.715 12a7.682 7.682 0 0 1-.959 3.727l3.109 3.107A11.943 11.943 0 0 0 24 12c0-2.54-.79-4.894-2.135-6.834z", + ], + }, +); diff --git a/doc/_static/style.css b/doc/_static/style.css index de7d109d68a..1899d67d873 100644 --- a/doc/_static/style.css +++ b/doc/_static/style.css @@ -32,6 +32,7 @@ html[data-theme="light"] { --mne-color-discourse: #d0232b; --mne-color-mastodon: #2F0C7A; --mne-color-sponsor: #BF3989; /* from GH sponsor heart, via browser devtools */ + --mne-color-opencollective: #1F87FF; /* scraped from logo SVG */ /* code block copy button */ --copybtn-opacity: 0.75; /* card header bg color */ @@ -65,6 +66,7 @@ html[data-theme="dark"] { --mne-color-discourse: #FFF9AE; /* from their logo SVG */ --mne-color-mastodon: #858AFA; /* www.joinmastodon.org/en/branding */ --mne-color-sponsor: #DB61A2; /* from GH sponsor heart, via browser devtools */ + --mne-color-opencollective: #99CFFF; /* scraped from logo SVG */ /* code block copy button */ --copybtn-opacity: 0.25; /* card header bg color */ @@ -270,6 +272,9 @@ aside.footnote:last-child { .navbar-icon-links svg.fa-heart { color: var(--mne-color-sponsor); } +.navbar-icon-links svg.fa-opencollective { + color: var(--mne-color-opencollective); +} /* ************************************************************ nav elements */ /* topbar nav inactive */ diff --git a/doc/conf.py b/doc/conf.py index f008c696ea9..f16b2d6307e 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -805,6 +805,11 @@ def fix_sklearn_inherited_docstrings(app, what, name, obj, options, lines): url="https://github.com/sponsors/mne-tools", icon="fa-regular fa-heart fa-fw", ), + dict( + name="Donate via OpenCollective", + url="https://opencollective.com/mne-python", + icon="fa-custom fa-opencollective fa-fw", + ), ], "icon_links_label": "External Links", # for screen reader "use_edit_page_button": False, @@ -845,6 +850,9 @@ def fix_sklearn_inherited_docstrings(app, what, name, obj, options, lines): html_css_files = [ "style.css", ] +html_js_files = [ + ("js/custom-icons.js", {"defer": "defer"}), +] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied From f10f0e0ed10614f8af6daf1889e0a4f98607617d Mon Sep 17 00:00:00 2001 From: Daniel McCloy Date: Thu, 17 Jul 2025 14:53:53 -0500 Subject: [PATCH 3/4] don't use square icon for GH repo link --- doc/_static/style.css | 2 +- doc/conf.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/_static/style.css b/doc/_static/style.css index 1899d67d873..16b96ae6c11 100644 --- a/doc/_static/style.css +++ b/doc/_static/style.css @@ -257,7 +257,7 @@ aside.footnote:last-child { } /* ******************************************************* navbar icon links */ -.navbar-icon-links svg.fa-square-github { +.navbar-icon-links svg.fa-github { color: var(--mne-color-github); } .navbar-icon-links svg.fa-discourse { diff --git a/doc/conf.py b/doc/conf.py index f16b2d6307e..91fda87af67 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -798,7 +798,7 @@ def fix_sklearn_inherited_docstrings(app, what, name, obj, options, lines): dict( name="GitHub", url="https://github.com/mne-tools/mne-python", - icon="fa-brands fa-square-github fa-fw", + icon="fa-brands fa-github fa-fw", ), dict( name="Sponsor on GitHub", From 7120662be3adc0c9e2bdf2d98d2da6b1658c615c Mon Sep 17 00:00:00 2001 From: Daniel McCloy Date: Thu, 17 Jul 2025 14:55:07 -0500 Subject: [PATCH 4/4] better hover text --- doc/conf.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 91fda87af67..b735b1d7fca 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -780,7 +780,7 @@ def fix_sklearn_inherited_docstrings(app, what, name, obj, options, lines): html_theme_options = { "icon_links": [ dict( - name="Discord", + name="Discord (office hours)", url="https://discord.gg/rKfvxTuATa", icon="fa-brands fa-discord fa-fw", ), @@ -791,17 +791,17 @@ def fix_sklearn_inherited_docstrings(app, what, name, obj, options, lines): attributes=dict(rel="me"), ), dict( - name="Forum", + name="Q&A Forum", url="https://mne.discourse.group/", icon="fa-brands fa-discourse fa-fw", ), dict( - name="GitHub", + name="Code Repository", url="https://github.com/mne-tools/mne-python", icon="fa-brands fa-github fa-fw", ), dict( - name="Sponsor on GitHub", + name="Sponsor us on GitHub", url="https://github.com/sponsors/mne-tools", icon="fa-regular fa-heart fa-fw", ),