From 6539727651a510a4d23a4e40a29079fd0710404d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Melissa=20Weber=20Mendon=C3=A7a?= Date: Fri, 3 May 2024 17:49:20 -0300 Subject: [PATCH 1/6] Remove PyData Sphinx Theme pin Includes fixes for the primary sidebar compatible with PST 0.15.3 --- .../static/css/napari-sphinx-theme.css | 23 +++++++++---------- pyproject.toml | 2 +- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/napari_sphinx_theme/static/css/napari-sphinx-theme.css b/napari_sphinx_theme/static/css/napari-sphinx-theme.css index 05a5e921..d770a4eb 100644 --- a/napari_sphinx_theme/static/css/napari-sphinx-theme.css +++ b/napari_sphinx_theme/static/css/napari-sphinx-theme.css @@ -308,14 +308,21 @@ button.version-switcher__button { sidebar ***************************/ -.bd-sidebar label { - left: 0px; +.bd-search { + border: 1px solid transparent; +} + +/* Remove "Section Navigation" caption */ +.bd-links__title { + display: none; } -.bd-sidebar-primary label.toctree-toggle:hover { - background: none; +/* Move chevron to the left */ +.bd-sidebar-primary li.has-children>details>summary .toctree-toggle { + right: unset; } +/* Fonts and styles */ .bd-sidebar a.reference, .bd-sidebar .caption-text { font-size: 0.875rem; @@ -327,10 +334,6 @@ button.version-switcher__button { margin-top: 0; } -.bd-search { - border: 1px solid transparent; -} - .bd-sidebar .toctree-l1 a { padding-left: 32px; } @@ -439,10 +442,6 @@ button.version-switcher__button { color: var(--napari-color-text-base); } -.navbar-nav .toctree-checkbox:checked~label i { - transform: rotate(90deg); -} - nav.bd-links li>a { color: var(--napari-color-text-base); display: block; diff --git a/pyproject.toml b/pyproject.toml index 29907ca4..41d3bb2d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ authors = [ {name = "napari team" }] requires-python = ">=3.7" dependencies = [ - "pydata-sphinx-theme==0.14.4", + "pydata-sphinx-theme>=0.14.4", "packaging", ] From f9bc31090f72a553dbea0f72ec87eefa97764067 Mon Sep 17 00:00:00 2001 From: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com> Date: Wed, 27 Mar 2024 19:23:19 -0400 Subject: [PATCH 2/6] [Maint] use setuptools_scm for versioning (#159) * use setuptools_scm for versioning * ensure checkout depth is correctly set * remove problematic [tool.setuptools.dynamic] --- .github/workflows/build_napari.yml | 3 +++ .github/workflows/deploy.yml | 2 ++ napari_sphinx_theme/__init__.py | 6 ++++-- pyproject.toml | 6 +++--- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_napari.yml b/.github/workflows/build_napari.yml index d09dd5f2..945f501b 100644 --- a/.github/workflows/build_napari.yml +++ b/.github/workflows/build_napari.yml @@ -17,6 +17,9 @@ jobs: steps: - name: Clone napari-sphinx-theme uses: actions/checkout@v4 + with: + # ensure version metadata is proper + fetch-depth: 0 - name: Clone napari docs repo uses: actions/checkout@v4 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 3800e3d1..a01c0cb7 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -25,6 +25,8 @@ jobs: python-version: [3.9] steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 diff --git a/napari_sphinx_theme/__init__.py b/napari_sphinx_theme/__init__.py index 38765cd0..b413e2c1 100644 --- a/napari_sphinx_theme/__init__.py +++ b/napari_sphinx_theme/__init__.py @@ -3,8 +3,10 @@ from .napari_code_theme import * -__version__ = "0.3.3.dev0" - +try: + from ._version import version as __version__ +except ImportError: + __version__ = 'not-installed' def update_templates(app, pagename, templatename, context, doctree): """Update template names for page build.""" diff --git a/pyproject.toml b/pyproject.toml index 41d3bb2d..4b44b7da 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=61.0"] +requires = ["setuptools>=64", "setuptools_scm>=8"] build-backend = "setuptools.build_meta" [project] @@ -49,8 +49,8 @@ repository = "https://github.com/napari/napari-sphinx-theme" packages = ["napari_sphinx_theme"] zip-safe = false -[tool.setuptools.dynamic] -version = {attr = "napari_sphinx_theme.__version__"} +[tool.setuptools_scm] +version_file = "napari_sphinx_theme/_version.py" [tool.setuptools.package-data] napari_sphinx_theme = [ From 74c8fd8af92b94bce07cbaf0fc9b6bbc3b75e60c Mon Sep 17 00:00:00 2001 From: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com> Date: Fri, 12 Apr 2024 18:17:13 -0400 Subject: [PATCH 3/6] Update build_napari.yml to drop doctrees (#160) --- .github/workflows/build_napari.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/build_napari.yml b/.github/workflows/build_napari.yml index 945f501b..b3737e52 100644 --- a/.github/workflows/build_napari.yml +++ b/.github/workflows/build_napari.yml @@ -85,12 +85,9 @@ jobs: # problems with screenshots (https://github.com/napari/docs/issues/285) linux-setup: "echo 'skip setup'" linux-teardown: "echo 'skip teardown'" - - - name: remove .doctrees folder (400Mb) - run: rm -rf napari-docs/docs/_build/.doctrees - name: Upload artifact uses: actions/upload-artifact@v4 with: name: napari-docs - path: napari-docs/docs/_build \ No newline at end of file + path: napari-docs/docs/_build/html/ From 9df68b441d3f22f91c7877b97a1637459e66cd4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Melissa=20Weber=20Mendon=C3=A7a?= Date: Tue, 28 May 2024 18:43:55 -0300 Subject: [PATCH 4/6] Bump pydata sphinx theme version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 4b44b7da..6d0e2fa6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ authors = [ {name = "napari team" }] requires-python = ">=3.7" dependencies = [ - "pydata-sphinx-theme>=0.14.4", + "pydata-sphinx-theme>=0.15.3", "packaging", ] From df07e09be7765b9d778abe3a7cb711f73893407a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Melissa=20Weber=20Mendon=C3=A7a?= Date: Tue, 28 May 2024 19:06:17 -0300 Subject: [PATCH 5/6] Fix navbar text decoration --- napari_sphinx_theme/static/css/napari-sphinx-theme.css | 5 ----- 1 file changed, 5 deletions(-) diff --git a/napari_sphinx_theme/static/css/napari-sphinx-theme.css b/napari_sphinx_theme/static/css/napari-sphinx-theme.css index 3b5f41ba..35410fd4 100644 --- a/napari_sphinx_theme/static/css/napari-sphinx-theme.css +++ b/napari_sphinx_theme/static/css/napari-sphinx-theme.css @@ -247,7 +247,6 @@ h1 { color: var(--napari-color-text-base) !important; font-size: 1.0625rem; padding: 15px 1.0625rem 15px !important; - border-bottom: .1875rem solid transparent; font-weight: 500 !important; } @@ -260,10 +259,6 @@ h1 { border-bottom: .1875rem solid var(--napari-color-text-base); } -.bd-header .navbar-nav>.current>.nav-link { - border-bottom: .1875rem solid var(--napari-color-text-base); -} - .col-lg-9.navbar-header-items { max-width: 75%; } From 7d93ffc1297e68381a1d2f9f9cc2082d11a7936b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Melissa=20Weber=20Mendon=C3=A7a?= Date: Wed, 29 May 2024 18:22:44 -0300 Subject: [PATCH 6/6] Fix navbar text decoration, take 2 --- .../static/css/napari-sphinx-theme.css | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/napari_sphinx_theme/static/css/napari-sphinx-theme.css b/napari_sphinx_theme/static/css/napari-sphinx-theme.css index 35410fd4..03a82bdd 100644 --- a/napari_sphinx_theme/static/css/napari-sphinx-theme.css +++ b/napari_sphinx_theme/static/css/napari-sphinx-theme.css @@ -215,15 +215,6 @@ h1 { box-shadow: none; } -.navbar .nav-item.active a { - font-weight: 700 !important; -} - -.navbar .nav-item a>i { - margin-left: 0.5rem; - font-size: 0.875rem !important; -} - .navbar-brand { vertical-align: middle; font-size: 1.25rem; @@ -237,30 +228,36 @@ h1 { color: var(--napari-color-text-base) !important; } -.navbar .navbar-brand p.title { - font-size: 1rem; - line-height: 125%; +.bd-header .navbar-nav li.pst-header-nav-item { + font-size: 1.0625rem; + font-weight: 500 !important; } -.navbar .nav-item a { - text-decoration-line: none; +.navbar-icon-links li.nav-item a.nav-link { color: var(--napari-color-text-base) !important; - font-size: 1.0625rem; - padding: 15px 1.0625rem 15px !important; - font-weight: 500 !important; } -.bd-header .navbar-nav li a.nav-link { - font-weight: bold; +.bd-header .navbar-nav li.pst-header-nav-item>.nav-link { + color: var(--napari-color-text-base) !important; + border-bottom: 3px solid transparent; } -.bd-header .navbar-nav li a.nav-link:hover { - text-decoration: none !important; - border-bottom: .1875rem solid var(--napari-color-text-base); +.bd-header .navbar-nav li.pst-header-nav-item>.nav-link:hover { + color: var(--napari-color-text-base) !important; + border-bottom: 3px solid var(--pst-color-primary); } -.col-lg-9.navbar-header-items { - max-width: 75%; +.bd-header .navbar-nav li.pst-header-nav-item.current>.nav-link::before { + border-bottom: 0px solid var(--pst-color-primary); +} + +.bd-header .navbar-nav li.pst-header-nav-item.current>.nav-link { + border-bottom: 3px solid var(--pst-color-primary); + font-weight: 700 !important; +} + +.bd-header .navbar-nav li.pst-header-nav-item>.nav-link { + padding: 15px 1.0625rem 15px !important; } /*************************** @@ -647,6 +644,10 @@ a.headerlink { transform: scale(1.01); } +.prev-next-area p { + color: var(--napari-color-text-base); +} + /*************************** Admonitions ***************************/ @@ -1014,7 +1015,6 @@ div.admonition.note>.admonition-title::after { color: var(--napari-dark-gray); } - /*************************** Calendar popup ***************************/