Skip to content

Commit

Permalink
Merge main into feature-focus (#1685)
Browse files Browse the repository at this point in the history
* Build(deps): Bump actions/setup-python from 4 to 5 (#1590)

Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](actions/setup-python@v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Use pytest-regressions to mark expected a11y test failures (#1501)

* Use pytest-regressions with a11y tests to mark expected failures

* Update tests/test_a11y.py

* frozen data class

* Revert "frozen data class"

This reverts commit 3b0c73e.

---------

Co-authored-by: Daniel McCloy <dan@mccloy.info>

* FIX: avoid implicit string comparison in Sphinx 7.26 (#1592)

* FIX: avoid implicit string comparison in Sphinx 7.26

* lint

---------

Co-authored-by: Daniel McCloy <dan@mccloy.info>

* Build(deps): Bump actions/upload-artifact from 3 to 4 (#1598)

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@v3...v4)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update fontawesome from 6.1.2 to 6.5.1 (#1600)

* Fix landmark-unique error due to in-page TOC (#1607)

* landmark unique error due to in-page TOC

* Apply suggestions from code review

Co-authored-by: Tania Allard <taniar.allard@gmail.com>

* fix lint?

---------

Co-authored-by: Tania Allard <taniar.allard@gmail.com>

* Feature: Add support for per-page secondary sidebar content (#1572)

* Add ability to set per-page secondary sidebars

* Add additional secondary sidebar content tests; expanded utils docstring

* Update translation files (#1606)

* Bump minimum Python from 3.8 to 3.9; add 3.12 to CIs (#1610)

drop py3.8, add py3.12

* Fix: more efficient determination of when to hide primary sidebar (#1609)

* minor refactors suggested by Ruff

* move TOC generation from layout.html to sidebar-primary.html

* replace @lru_cache(None) with plain @cache

* get sidebar TOC length without rendering it

* fixup rebase/stash snafu

* bugfix

* Fix "More" links in mobile sidebar (#1604)

Fix #1603

* bump: 0.14.4 → 0.15.0rc0

* Updates for file src/pydata_sphinx_theme/locale/en/LC_MESSAGES/sphinx.po in fr (#1618)

i18n: Translate sphinx.po in fr

100% translated source file: 'sphinx.po'
on 'fr'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>

* bump: 0.14.4 → 0.15.0

* fix: drop the dev test (#1623)

* fix: remove Site navigation header (#1615)

* fix: remove Site navigation header

* test: edit the test suit

* fix: align all breadcrumb elements (#1619)

* fix: log information when warnings are disabled (#1617)

* bump: 0.15.0 → 0.15.1

* back to dev

* fix: align the search button with other icons (#1620)

* test: display the search button for demo purposes

* fix: only display the search icon

* fix: remove needless adjustements

* fix: rollback to default search

* chore: trigger CI

* Fix sticky header (#1630)

* Fix sticky header

* regression test

* maybe fix missing sidebar? (#1632)

* maybe fix missing sidebar?

* simplify

* purge internal defaults & use theme config setting

* formatting

* refactor and simplify toctree code

* DOC: Add missing "footer_center" in layout overview diagram (#1640)

* Make bootstrap globally available (#1639)

* Make bootstrap globally available

* Include docs about bootstrap programmatic API

* Add Brightway to Featured Example Gallery Grid (#1580)

* initial commit

* test: the png images are not build during tests

---------

Co-authored-by: Rambaud Pierrick <12rambau@users.noreply.github.com>

* fix: move the release instructions to the repository (#1621)

* fix: update text and links

* fix: add code highlight

* fix: wire correct file in our documentation

* chore: trigger CI

* remove mention of semantic versioning

Co-authored-by: Daniel McCloy <dan@mccloy.info>

* refactor: lint

* Update RELEASE.md

---------

Co-authored-by: Daniel McCloy <dan@mccloy.info>

* Make search event listener only trigger with “K”/“k” (#1646)

* More speedups to section TOC rendering (#1642)

* small refactor, comments, cleanup

* docstring cleanups

* mark as unsafe for parallel write

* Update src/pydata_sphinx_theme/toctree.py

* Allow only theme_footer_center to be set (#1653)

* fix: allow user to control the back-to-top button presence (#1616)

* fix: put the btt button closer to age bottom

* test: remove the btt button to check

* test: fallback to default behaviour

* refactor: rollback to previous state

* use proper variable name

* Update src/pydata_sphinx_theme/theme/pydata_sphinx_theme/layout.html

---------

Co-authored-by: Daniel McCloy <dan@mccloy.info>

* remove toggle button for secondary sidebar if empty (#1637)

* in CIs, pin sphinx dev temporarily

* bump: 0.15.1 -> 0.15.2

* bump version to dev

* FIX make theme switcher have consistent widths (#1651)

* unpin sphinx in CI (#1665)

* FIX make search button closer to other icons in topbar (#1659)

* Build(deps): Bump actions/cache from 3 to 4 (#1667)

Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](actions/cache@v3...v4)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* update dependabot labels (#1668)

* only do security updates for NPM (#1674)

* Restore search snippet highlights in search results page (#1678)

* Apply default_mode to the html data-theme attribute (#1663)

* Don't try to populate version switcher w/ relative path on local static site (#1660)

* Don't try to populate version switcher on static sites

* Fix comment spelling

* Update src/pydata_sphinx_theme/assets/scripts/pydata-sphinx-theme.js

---------

Co-authored-by: Daniel McCloy <dan@mccloy.info>

* handle null result from queryselector (#1683)

fix queryselector

* Add pst-header-nav-item id to fix tests

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Daniel McCloy <dan@mccloy.info>
Co-authored-by: Angus Hollands <goosey15@gmail.com>
Co-authored-by: Sebastiaan Huber <mail@sphuber.net>
Co-authored-by: Tania Allard <taniar.allard@gmail.com>
Co-authored-by: Peyton Murray <peynmurray@gmail.com>
Co-authored-by: Rambaud Pierrick <12rambau@users.noreply.github.com>
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
Co-authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Co-authored-by: Michael Wisely <108433848+michael-wisely-gravwell@users.noreply.github.com>
Co-authored-by: Michael Weinold <23102087+michaelweinold@users.noreply.github.com>
Co-authored-by: Philipp A <flying-sheep@web.de>
Co-authored-by: Colin Marquardt <cmarqu42@gmail.com>
Co-authored-by: Pierre Marchand <PierreMarchand20@users.noreply.github.com>
Co-authored-by: Yao Xiao <108576690+Charlie-XIAO@users.noreply.github.com>
Co-authored-by: Charles <peacech@gmail.com>
Co-authored-by: David Stansby <dstansby@gmail.com>
  • Loading branch information
18 people committed Jan 31, 2024
1 parent 97f939b commit 931b9ab
Show file tree
Hide file tree
Showing 84 changed files with 869 additions and 316 deletions.
15 changes: 13 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
# GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
labels:
- "tag: dependencies"
- "tag: CI"
# npm
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
labels:
- "tag: dependencies"
- "tag: javascript"
open-pull-requests-limit: 0 # security updates only
4 changes: 2 additions & 2 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Checkout source
uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Install gettext for translations
Expand Down
46 changes: 24 additions & 22 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.11"]
python-version: ["3.12"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
Expand All @@ -44,22 +44,22 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
sphinx-version: [""]
include:
# macos test
- os: macos-latest
python-version: "3.11"
python-version: "3.12"
# windows test
- os: windows-latest
python-version: "3.11"
python-version: "3.12"
# old Sphinx test
- os: ubuntu-latest
python-version: "3.8"
python-version: "3.9"
sphinx-version: "old"
# dev Sphinx test
- os: ubuntu-latest
python-version: "3.11"
python-version: "3.12"
sphinx-version: "dev"
# needed to cache the browsers for the accessibility tests
env:
Expand All @@ -69,7 +69,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
Expand All @@ -93,7 +93,7 @@ jobs:
- name: Run tests
run: pytest -m "not a11y" --color=yes --cov --cov-report=xml
- name: Upload to Codecov
if: matrix.python-version == '3.11' && matrix.os == 'ubuntu-latest'
if: matrix.python-version == '3.12' && matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand All @@ -102,7 +102,7 @@ jobs:
# note I am setting this on top of the Python cache as I could not find
# how to set the hash key on the python one
- name: Set up browser cache (for accessibility tests)
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/pw-browsers
Expand All @@ -111,7 +111,7 @@ jobs:
${{ runner.os }}-pw-
- name: Run accessibility tests with playwright
if: matrix.python-version == '3.11' && matrix.os == 'ubuntu-latest'
if: matrix.python-version == '3.12' && matrix.os == 'ubuntu-latest'
run: |
nox -s a11y
continue-on-error: true
Expand All @@ -123,15 +123,17 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.11"]
python-version: ["3.12"]
sphinx-version: [""]
include:
- os: ubuntu-latest
python-version: "3.8"
python-version: "3.9"
sphinx-version: "old"
- os: ubuntu-latest
python-version: "3.11"
sphinx-version: "dev"
# crash with myst parser
# will be restored when myst will be dropped from our documentation
# - os: ubuntu-latest
# python-version: "3.12"
# sphinx-version: "dev"
env:
SPHINX_VERSION: ${{ matrix.sphinx-version }}
runs-on: ${{ matrix.os }}
Expand All @@ -141,7 +143,7 @@ jobs:
# using 12rambau fork until then
- uses: 12rambau/setup-pandoc@test
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
Expand All @@ -162,12 +164,12 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.11"]
python-version: ["3.12"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
Expand Down Expand Up @@ -205,12 +207,12 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.11"]
python-version: ["3.12"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
Expand All @@ -223,7 +225,7 @@ jobs:
- name: Generate a profile
run: nox -s profile
continue-on-error: true
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: profile-results
path: profile.svg
5 changes: 3 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ repos:
hooks:
- id: prettier
# Exclude the HTML, since it doesn't understand Jinja2
# exclude also the webpack.congo.js file has it embed complete url dificult to prettify
exclude: .+\.html|webpack\.config\.js
# exclude also the webpack.config.js file has it embed complete url dificult to prettify
# exclude the pytest-regressions folder tests/test_ally
exclude: .+\.html|webpack\.config\.js|tests/test_a11y/

- repo: https://github.com/psf/black
rev: 22.12.0
Expand Down
36 changes: 36 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Release instructions

This page contains the steps to make a release and some helpful resources to get you started.

Create an issue and copy/paste the steps below to release a new version. Close the issue when it is done.

These steps should be taken in order to create a new release![^release-refs]

```md
**Double check for quality-control**

- [ ] There are no [open issues with a `impact: block-release` label](https://github.com/pydata/pydata-sphinx-theme/labels/impact%3A%20block-release)

**Prepare the codebase for a new version**

- [ ] Bump `__version__` in [`__init__.py`](https://github.com/pydata/pydata-sphinx-theme/blob/main/src/pydata_sphinx_theme/__init__.py#L16)
- [ ] Update our [version switcher `.json` file](https://github.com/pydata/pydata-sphinx-theme/blob/main/docs/_static/switcher.json) with the new version
- [ ] Make a release commit: `git commit -m 'bump: 0.1.9 → 0.2.0'`
- [ ] Push the RLS commit `git push upstream main`
- [ ] If a **release candidate** is needed, tick this box when we're now ready for a full release.

**Make the release**

- [ ] [Start a new GitHub release](https://github.com/pandas-dev/pydata-sphinx-theme/releases/new)
- Call the release the current version, e.g. `v0.2.0`
- In the **`Choose a Tag:`** dropdown, type in the release name (e.g., `v0.2.0`) and click "Create new tag"
- In the **`Target:`** dropdown, pin it to the release commit that you've just pushed.
- Generate the automatic release notes, eventually manually specify the previous version (useful when several release candidate have been made)
- [ ] Confirm that the release completed
- [The `publish` github action job](https://github.com/pydata/pydata-sphinx-theme/blob/main/.github/workflows/publish.yml#L31) has completed successfully in the [actions tab](https://github.com/pydata/pydata-sphinx-theme/actions).
- [The PyPI version is updated](https://pypi.org/project/pydata-sphinx-theme/)
- [ ] Hide the previous patch version build in the RDT interface if needed.
- [ ] Celebrate, you're done!

[^release-refs]: Taken from [the release checklist](https://github.com/pydata/pydata-sphinx-theme/blob/main/RELEASE.md). See [the release documentation](https://pydata-sphinx-theme.readthedocs.io/en/latest/contribute/policies.html#release-policy) for an overview of release processes.
```
3 changes: 3 additions & 0 deletions docs/_static/gallery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
- title: Bokeh
link: https://docs.bokeh.org/en/latest/
img-bottom: ../_static/gallery/bokeh.png
- title: Brightway
link: https://docs.brightway.dev/en/latest/
img-bottom: ../_static/gallery/brightway.png
- title: Jupyter
link: https://docs.jupyter.org/en/latest/
img-bottom: ../_static/gallery/jupyter.png
Expand Down
14 changes: 7 additions & 7 deletions docs/_static/switcher.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@
"url": "https://pydata-sphinx-theme.readthedocs.io/en/latest/"
},
{
"name": "0.14.4 (stable)",
"version": "v0.14.4",
"name": "0.15.2 (stable)",
"version": "v0.15.2",
"url": "https://pydata-sphinx-theme.readthedocs.io/en/stable/",
"preferred": true
},
{
"name": "0.14.4",
"version": "v0.14.4",
"url": "https://pydata-sphinx-theme.readthedocs.io/en/v0.14.4/"
},
{
"name": "0.13.3",
"version": "v0.13.3",
Expand All @@ -23,10 +28,5 @@
"name": "0.11.0",
"version": "v0.11.0",
"url": "https://pydata-sphinx-theme.readthedocs.io/en/v0.11.0/"
},
{
"name": "0.10.1",
"version": "v0.10.1",
"url": "https://pydata-sphinx-theme.readthedocs.io/en/v0.10.1/"
}
]
4 changes: 2 additions & 2 deletions docs/community/practices/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Anybody is encouraged to make a new release if:

- It has been more than a month since the last release.
- OR a significant change has been made to our code that warrants a release.
- AND there are no open issues with a [{guilabel}`block-release`](https://github.com/pydata/pydata-sphinx-theme/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Ablock-release) label.
- AND there are no open issues with a [{guilabel}`impact: block-release`](https://github.com/pydata/pydata-sphinx-theme/labels/impact%3A%20block-release) label.

### Release candidates

Expand All @@ -35,7 +35,7 @@ Follow these steps to make a release:

- (optionally) **Create a [GitHub milestones](https://github.com/pydata/pydata-sphinx-theme/milestones)** to organize the issues that should be resolved as part of a new release.
- **Decide if it's time** to make a release be reading [](releases:when) and decide if it is time for a release.
- **Copy the release checklist into a new issue**. We have [a release checklist in our wiki](https://github.com/pydata/pydata-sphinx-theme/wiki/Release-checklist#release-instructions).
- **Copy the [release checklist](https://github.com/pydata/pydata-sphinx-theme/blob/main/RELEASE.md) into a new issue**.
- **Complete the checklist**. That's it!

## Choosing a version increment
Expand Down
1 change: 1 addition & 0 deletions docs/community/topics/bootstrap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,4 @@ JavaScript
^^^^^^^^^^

- Data attributes for all JavaScript plugins are now namespaced to help distinguish Bootstrap functionality from third parties and your code. For example, we use ``data-bs-toggle`` instead of ``data-toggle``.
- Bootstrap's `Programmatic API <https://getbootstrap.com/docs/5.0/getting-started/javascript/#programmatic-api>`_, ``bootstrap``, is also available. This API can be useful for initializing opt-in components that are not initialized by default such as `Popovers <https://getbootstrap.com/docs/5.0/components/popovers/#overview>`_.
6 changes: 5 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,16 @@
# "content_footer_items": ["test", "test"],
"footer_start": ["copyright"],
"footer_center": ["sphinx-version"],
# "secondary_sidebar_items": ["page-toc"], # Remove the source buttons
"secondary_sidebar_items": {
"**/*": ["page-toc", "edit-this-page", "sourcelink"],
"examples/no-sidebar": [],
},
"switcher": {
"json_url": json_url,
"version_match": version_match,
},
"navigation_with_keys": False,
# "back_to_top_button": False,
# "search_bar_position": "navbar", # TODO: Deprecated - remove in future version
}

Expand Down
2 changes: 0 additions & 2 deletions docs/examples/gallery.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ Thanks for your support!
- title: Binder
link: https://mybinder.readthedocs.io/en/latest/index.html
- title: Brightway
link: https://docs.brightway.dev/en/latest/
- title: cashocs
link: https://cashocs.readthedocs.io/en/stable/
- title: CuPy
Expand Down
49 changes: 49 additions & 0 deletions docs/examples/in-page-toc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
:html_theme.sidebar_secondary.remove: true

Test of in-page TOC with no right sidebar
=========================================

This page tests that the local contents directive looks okay.

.. attention::

We **do not recommend** using this directive on pages that use this theme
because PyData Theme provides an in-page table of contents in the right sidebar
by default.

If you do choose to use an inline, in-page table of contents, we recommend that
you turn off the right sidebar as follows.

.. contents:: Page contents
:local:


Add a local table of contents (in-page)
---------------------------------------

Add the local table of contents directive near the top of your ``.rst`` page:

.. code-block:: rst
.. contents:: Page contents
:local:
This directive will generate a table of contents for the section where this was
added, as shown on this page.


Turn off the right sidebar for a single page
--------------------------------------------

On the very top line of your ``.rst`` file, insert the following line:

.. code-block:: rst
:html_theme.sidebar_secondary.remove: true
This will render the page without the right sidebar, also known as the secondary
sidebar, which contains the table of contents for that page.

Be aware that if you remove the sidebar you may also remove the "Edit on ..."
and "Show source" links for that page, since by default those are configured for
the right sidebar.
1 change: 1 addition & 0 deletions docs/examples/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ See the sections in the primary sidebar and below to explore.

no-sidebar
persistent-search-field
in-page-toc
subpages/index
mult_headers
Link to an external site <https://jupyterbook.org/>
Expand Down

0 comments on commit 931b9ab

Please sign in to comment.