Skip to content

Commit 02426cc

Browse files
12rambautransifex-integration[bot]dependabot[bot]drammockgabalafou
authored
update to latest main (#12)
* chore(i18n) catalan (pydata#1488) i18n: Translate sphinx.po in ca 100% translated source file: 'sphinx.po' on 'ca'. Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com> * Build(deps): Bump postcss and css-loader (pydata#1494) Bumps [postcss](https://github.com/postcss/postcss) to 8.4.31 and updates ancestor dependency [css-loader](https://github.com/webpack-contrib/css-loader). These dependencies need to be updated together. Updates `postcss` from 8.4.21 to 8.4.31 - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](postcss/postcss@8.4.21...8.4.31) Updates `css-loader` from 3.6.0 to 6.8.1 - [Release notes](https://github.com/webpack-contrib/css-loader/releases) - [Changelog](https://github.com/webpack-contrib/css-loader/blob/master/CHANGELOG.md) - [Commits](webpack-contrib/css-loader@v3.6.0...v6.8.1) --- updated-dependencies: - dependency-name: postcss dependency-type: indirect - dependency-name: css-loader dependency-type: direct:development ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Revert "Build(deps): Bump postcss and css-loader" (pydata#1509) Revert "Build(deps): Bump postcss and css-loader (pydata#1494)" This reverts commit 185a37a. * Update pst docs buttons (pydata#1502) * call them button-links * copy edit * docs: link back to GitHub from PyPI metadata (pydata#1504) This will add a "Source" link in the PyPI page. * navigation_with_keys = False (pydata#1503) * navigation_with_keys = False * None -> False * Apply suggestions from code review --------- Co-authored-by: Daniel McCloy <[email protected]> * fix: convert "stable" to actual version number (pydata#1512) * convert "stable" to actual version number * fix tests re: navigation_with_keys * try bumping autoapi * refactor: use nbsphinx as the default execution lib (pydata#1482) * refactor: use nbsphinx as the default execution lib * add nbstripout to the pre-commits' * add pandoc to the readthedocs deps * refactor: clean the notebook * move the example to the correct folder * fix: solve link issue * install pandoc in the test environment * fix: display of large table in executed cells * avoid Userwarnings from matplotlib * hide the matplotlib wrning management cell * Update readthedocs.yml * build: use pandoc_binary to install pandoc * docs: add reference to pandoc in the setup * update docs * remove pypandoc_binary * Update pyproject.toml Co-authored-by: gabalafou <[email protected]> * ci: use back setup-pandoc * Trigger CI build --------- Co-authored-by: Gabriel Fouasnon <[email protected]> * BUG - Clear alt_text in conf.py (pydata#1471) * comment out alt_text in conf.py * set alt_text to empty string * remove alt_text from conf.py * fix: use 12rambau fork until it's merged with nikeee repo (pydata#1517) * deps: drop support for Sphinx 5 (pydata#1516) * remove ref to myst-nb * update minimal supported version of sphinx * Fix: (webpack.config.js) css-loader API change (pydata#1508) * Fix: (webpack.config.js) css-loader API change The build was broken in <https://github.com/pydata/pydata-sphinx-theme/commit/185a37aa36820f77bffa4c87a772092e9e7cc380>/<https://github.com/pydata/pydata-sphinx-theme/pull/1494>. This change fixes the build, and it seems to be in accordance with the current API as described at <https://github.com/webpack-contrib/css-loader/blob/c6f36cf91ac61743a70e81cfb077faa0f8730ebe/README.md#boolean>. Closes <pydata#1507>. * dedup * restore version bump --------- Co-authored-by: Daniel McCloy <[email protected]> * Fix duplicate HTML IDs (pydata#1425) * Fix duplicate HTML IDs * fix tests * Do not animate the version admonitions colors. (pydata#1424) Otherwise a delay has to be added to the accessibility color contrast checks, to wait for the colors to fully transition. * BUG - Remove redundant ARIA in breadcrumb navigation (pydata#1426) * style(i18n): French Typo fixed (pydata#1430) * Add the ability to add a center section to the footer (pydata#1432) * Add a center section for the footer * Add docs for footer_center * Add a test site for the center footer * test it in our own docs * remove new test site * add footer test --------- Co-authored-by: Daniel McCloy <[email protected]> * Build(deps): Bump actions/checkout from 3 to 4 (pydata#1433) Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add dropdown_text argument to generate_header_nav_html (pydata#1423) * Add dropdown_text argument to generate_header_nav_html * Add a test, fix typo in theme.conf and remove header_dropdown_text from docs/conf.py * fixed? --------- Co-authored-by: Daniel McCloy <[email protected]> * fix: rollback ref and Id changes (pydata#1438) * bump: version 0.13.3 → 0.14.0 (pydata#1440) * bump version * update version switcher * back to dev * fix: change the z-index of the dropdown (pydata#1442) In order to be on top of the primary sidebar on small screens. * fix: set the same background for dark/light (pydata#1443) * fix: set the same background for dark/light et the same background color for all state of the search field. It is currently only applied when hovered * fix: wrong css selector * Update src/pydata_sphinx_theme/assets/styles/components/_search.scss * Update src/pydata_sphinx_theme/assets/styles/components/_search.scss * Fix duplicate HTML IDs * fix tests * unique_html_id * backwards-compat generate_header_nav_html * feedback review * update fixture * ughhhh...caching * code cleanup * fix test snapshot * put comment inside def --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Denis Bitouzé <[email protected]> Co-authored-by: Stuart Mumford <[email protected]> Co-authored-by: Daniel McCloy <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Alenka Frim <[email protected]> Co-authored-by: Rambaud Pierrick <[email protected]> * chore: build the devcontainer automatically in codespace (pydata#1483) * chore: build the devcontainer automaticallyin codespace * refactor: lint * add pandoc to the environment * Fix font color in search input box (pydata#1524) * Fix color * Use --pst-color-text-base * docs: add DecentralChain (pydata#1528) Co-authored-by: jourlez <[email protected]> * Updates for file src/pydata_sphinx_theme/locale/en/LC_MESSAGES/sphinx.po in ru [Manual Sync] (pydata#1527) i18n: Translate sphinx.po in ru [Manual Sync] 96% of minimum 20% translated source file: 'sphinx.po' on 'ru'. Sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com> * ignore transient errors in windows build CI (pydata#1520) * use warning list * clean up notebook * refactor to pass on all platforms? * simplify * fix logic * iterate backwards * fix plaform detection? also don't log unnecessarily�[H * ignore empty string warnings * remove notebook metawarning * Revert "remove notebook metawarning" This reverts commit 42f4672. * try again * debug the mysterious empty warning * escape color codes * import * triage by intermittency, not by platform; better var names * simplify * fix list.remove * undo what I broke * Update tests/utils/check_warnings.py --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Daniel McCloy <[email protected]> Co-authored-by: gabalafou <[email protected]> Co-authored-by: Ned Batchelder <[email protected]> Co-authored-by: Adam Porter <[email protected]> Co-authored-by: Denis Bitouzé <[email protected]> Co-authored-by: Stuart Mumford <[email protected]> Co-authored-by: Alenka Frim <[email protected]> Co-authored-by: Harutaka Kawamura <[email protected]> Co-authored-by: jourlez <[email protected]>
1 parent 5cf5fad commit 02426cc

File tree

34 files changed

+739
-223
lines changed

34 files changed

+739
-223
lines changed

.devcontainer/devcontainer.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// container instruction for codespace users
2+
{
3+
"name": "Python 3",
4+
"image": "mcr.microsoft.com/devcontainers/python:1-3.10-bullseye",
5+
"features": {
6+
"ghcr.io/devcontainers-contrib/features/nox:2": {},
7+
"ghcr.io/devcontainers-contrib/features/pre-commit:2": {},
8+
"ghcr.io/rocker-org/devcontainer-features/pandoc:1": {}
9+
},
10+
"postCreateCommand": "pre-commit install"
11+
}

.github/workflows/tests.yml

+3
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ jobs:
137137
runs-on: ${{ matrix.os }}
138138
steps:
139139
- uses: actions/checkout@v4
140+
# waiting for https://github.com/nikeee/setup-pandoc/pull/8
141+
# using 12rambau fork until then
142+
- uses: 12rambau/setup-pandoc@test
140143
- name: Setup Python
141144
uses: actions/setup-python@v4
142145
with:

.pre-commit-config.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,8 @@ repos:
3838
rev: v1.1.1
3939
hooks:
4040
- id: doc8
41+
42+
- repo: "https://github.com/kynan/nbstripout"
43+
rev: "0.5.0"
44+
hooks:
45+
- id: nbstripout

docs/community/setup.md

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ To simplify this process, we use a few helper tools:
4242
- [The Sphinx Theme Builder](https://sphinx-theme-builder.readthedocs.io/en/latest/) compiles web assets in an automated way.
4343
- [pre-commit](https://pre-commit.com/) for automatically enforcing code standards and quality checks before commits.
4444
- [nox](https://nox.thea.codes/) for automating common development tasks.
45+
- [pandoc](https://pandoc.org/) the universal document converter.
4546

4647
In particular, `nox` can be used to automatically create isolated local development environments with all the correct packages installed to work on the theme.
4748
The rest of this guide focuses on using `nox` to start with a basic environment.

docs/community/topics/manual-dev.md

+13-9
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,34 @@ This is optional, but it's best to start with a fresh development environment so
1212

1313
To do so, use a tool like [conda](https://docs.conda.io/en/latest/), [mamba](https://github.com/mamba-org/mamba), or [virtualenv](https://virtualenv.pypa.io/).
1414

15-
## Clone the repository locally
15+
## Install dependencies
1616

17-
First clone this repository from the `pydata` organization, or from a fork that you have created:
17+
You must install `sphinx-theme-builder` and Pandoc.
18+
19+
We use the `sphinx-theme-builder` to install `nodejs` locally and to compile all CSS and JS assets needed for the theme.
20+
Install it like so (note the `cli` option so that we can run it from the command line):
1821

1922
```console
20-
$ git clone https://github.com/pydata/pydata-sphinx-theme
21-
$ cd pydata-sphinx-theme
23+
$ pip install "sphinx-theme-builder[cli]"
2224
```
2325

24-
## Install the `sphinx-theme-builder`
26+
We use `nbsphinx` to support notebook (.ipynb) files in the documentation, which requires [installing Pandoc](https://pandoc.org/installing.html) at a system level (or within a Conda environment).
2527

26-
We use the `sphinx-theme-builder` to install `nodejs` locally and to compile all CSS and JS assets needed for the theme.
27-
Install it like so (note the `cli` option so that we can run it from the command line):
28+
## Clone the repository locally
29+
30+
First clone this repository from the `pydata` organization, or from a fork that you have created:
2831

2932
```console
30-
$ pip install sphinx-theme-builder[cli]
33+
$ git clone https://github.com/pydata/pydata-sphinx-theme
34+
$ cd pydata-sphinx-theme
3135
```
3236

3337
## Install this theme locally
3438

3539
Next, install this theme locally so that we have the necessary dependencies to build the documentation and testing suite:
3640

3741
```console
38-
$ pip install -e .[dev]
42+
$ pip install -e ".[dev]"
3943
```
4044

4145
Note that the `sphinx-theme-builder` will automatically install a local copy of `nodejs` for building the theme's assets.

docs/conf.py

+14-12
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@
3434
"sphinx_design",
3535
"sphinx_copybutton",
3636
"autoapi.extension",
37-
"_extension.gallery_directive",
3837
# For extension examples and demos
38+
"myst_parser",
3939
"ablog",
4040
"jupyter_sphinx",
41-
"matplotlib.sphinxext.plot_directive",
42-
"myst_nb",
4341
"sphinxcontrib.youtube",
44-
# "nbsphinx", # Uncomment and comment-out MyST-NB for local testing purposes.
42+
"nbsphinx",
4543
"numpydoc",
4644
"sphinx_togglebutton",
4745
"jupyterlite_sphinx",
4846
"sphinx_favicon",
47+
# custom extentions
48+
"_extension.gallery_directive",
4949
]
5050

5151
# Add any paths that contain templates here, relative to this directory.
@@ -66,18 +66,18 @@
6666
sitemap_locales = [None]
6767
sitemap_url_scheme = "{link}"
6868

69-
# -- Internationalization ----------------------------------------------------
70-
71-
# specifying the natural language populates some key tags
72-
language = "en"
73-
7469
# -- MyST options ------------------------------------------------------------
7570

7671
# This allows us to use ::: to denote directives, useful for admonitions
7772
myst_enable_extensions = ["colon_fence", "linkify", "substitution"]
7873
myst_heading_anchors = 2
7974
myst_substitutions = {"rtd": "[Read the Docs](https://readthedocs.org/)"}
8075

76+
# -- Internationalization ----------------------------------------------------
77+
78+
# specifying the natural language populates some key tags
79+
language = "en"
80+
8181
# -- Ablog options -----------------------------------------------------------
8282

8383
blog_path = "examples/blog/index"
@@ -99,19 +99,21 @@
9999

100100
# Define the version we use for matching in the version switcher.
101101
version_match = os.environ.get("READTHEDOCS_VERSION")
102+
release = pydata_sphinx_theme.__version__
102103
# If READTHEDOCS_VERSION doesn't exist, we're not on RTD
103104
# If it is an integer, we're in a PR build and the version isn't correct.
104105
# If it's "latest" → change to "dev" (that's what we want the switcher to call it)
105106
if not version_match or version_match.isdigit() or version_match == "latest":
106107
# For local development, infer the version to match from the package.
107-
release = pydata_sphinx_theme.__version__
108108
if "dev" in release or "rc" in release:
109109
version_match = "dev"
110110
# We want to keep the relative reference if we are in dev mode
111111
# but we want the whole url if we are effectively in a released version
112112
json_url = "_static/switcher.json"
113113
else:
114-
version_match = "v" + release
114+
version_match = f"v{release}"
115+
elif version_match == "stable":
116+
version_match = f"v{release}"
115117

116118
html_theme_options = {
117119
"external_links": [
@@ -159,7 +161,6 @@
159161
"logo": {
160162
"text": "PyData Theme",
161163
"image_dark": "_static/logo-dark.svg",
162-
"alt_text": "PyData Theme",
163164
},
164165
"use_edit_page_button": True,
165166
"show_toc_level": 1,
@@ -181,6 +182,7 @@
181182
"json_url": json_url,
182183
"version_match": version_match,
183184
},
185+
"navigation_with_keys": False,
184186
# "search_bar_position": "navbar", # TODO: Deprecated - remove in future version
185187
}
186188

docs/examples/gallery.md

+2
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,6 @@ Thanks for your support!
4343
link: https://docs.pyvista.org
4444
- title: Pastas
4545
link: https://pastas.readthedocs.io/
46+
- title: DecentralChain
47+
link: https://docs.decentralchain.io/en/master/
4648
```

docs/examples/pydata.ipynb

+151
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# PyData Library Styles\n",
8+
"\n",
9+
"This theme has built-in support and special styling for several major visualization libraries in the PyData ecosystem.\n",
10+
"This ensures that the images and output generated by these libraries looks good for both light and dark modes.\n",
11+
"Below are examples of each that we use as a benchmark for reference.\n",
12+
"\n",
13+
"## Pandas"
14+
]
15+
},
16+
{
17+
"cell_type": "code",
18+
"execution_count": null,
19+
"metadata": {},
20+
"outputs": [],
21+
"source": [
22+
"import string\n",
23+
"\n",
24+
"import numpy as np\n",
25+
"import pandas as pd\n",
26+
"\n",
27+
"rng = np.random.default_rng()\n",
28+
"data = rng.standard_normal((100, 26))\n",
29+
"df = pd.DataFrame(data, columns=list(string.ascii_lowercase))\n",
30+
"df"
31+
]
32+
},
33+
{
34+
"cell_type": "markdown",
35+
"metadata": {},
36+
"source": [
37+
"## Matplotlib"
38+
]
39+
},
40+
{
41+
"cell_type": "code",
42+
"execution_count": null,
43+
"metadata": {},
44+
"outputs": [],
45+
"source": [
46+
"import matplotlib.pyplot as plt\n",
47+
"\n",
48+
"fig, ax = plt.subplots()\n",
49+
"ax.scatter(df[\"a\"], df[\"b\"], c=df[\"b\"], s=3)"
50+
]
51+
},
52+
{
53+
"cell_type": "code",
54+
"execution_count": null,
55+
"metadata": {},
56+
"outputs": [],
57+
"source": [
58+
"rng = np.random.default_rng()\n",
59+
"data = rng.standard_normal((3, 100))\n",
60+
"fig, ax = plt.subplots()\n",
61+
"ax.scatter(data[0], data[1], c=data[2], s=3)"
62+
]
63+
},
64+
{
65+
"cell_type": "markdown",
66+
"metadata": {},
67+
"source": [
68+
"## Plotly\n",
69+
"\n",
70+
"The HTML below shouldn't display, but it uses RequireJS to make sure that all\n",
71+
"works as expected. If the widgets don't show up, RequireJS may be broken."
72+
]
73+
},
74+
{
75+
"cell_type": "code",
76+
"execution_count": null,
77+
"metadata": {},
78+
"outputs": [],
79+
"source": [
80+
"import plotly.io as pio\n",
81+
"import plotly.express as px\n",
82+
"import plotly.offline as py\n",
83+
"\n",
84+
"pio.renderers.default = \"notebook\"\n",
85+
"\n",
86+
"df = px.data.iris()\n",
87+
"fig = px.scatter(df, x=\"sepal_width\", y=\"sepal_length\", color=\"species\", size=\"sepal_length\")\n",
88+
"fig"
89+
]
90+
},
91+
{
92+
"cell_type": "markdown",
93+
"metadata": {},
94+
"source": [
95+
"## Xarray\n",
96+
"\n",
97+
"Here we demonstrate `xarray` to ensure that it shows up properly."
98+
]
99+
},
100+
{
101+
"cell_type": "code",
102+
"execution_count": null,
103+
"metadata": {},
104+
"outputs": [],
105+
"source": [
106+
"import xarray as xr\n",
107+
"data = xr.DataArray(\n",
108+
" np.random.randn(2, 3),\n",
109+
" dims=(\"x\", \"y\"),\n",
110+
" coords={\"x\": [10, 20]}, attrs={\"foo\": \"bar\"}\n",
111+
" )\n",
112+
"data"
113+
]
114+
},
115+
{
116+
"cell_type": "markdown",
117+
"metadata": {},
118+
"source": [
119+
"## ipyleaflet\n",
120+
"\n",
121+
"`ipyleaflet` is a **Jupyter**/**Leaflet** bridge enabling interactive maps in the Jupyter notebook environment. this demonstrate how you can integrate maps in your documentation."
122+
]
123+
},
124+
{
125+
"cell_type": "code",
126+
"execution_count": null,
127+
"metadata": {},
128+
"outputs": [],
129+
"source": [
130+
"from ipyleaflet import Map, basemaps\n",
131+
"\n",
132+
"# display a map centered on France\n",
133+
"m = Map(basemap=basemaps.Esri.WorldImagery, zoom=5, center=[46.21, 2.21])\n",
134+
"m"
135+
]
136+
}
137+
],
138+
"metadata": {
139+
"kernelspec": {
140+
"display_name": "Python 3",
141+
"language": "python",
142+
"name": "python3"
143+
},
144+
"language_info": {
145+
"name": "python",
146+
"version": "3.10.8"
147+
}
148+
},
149+
"nbformat": 4,
150+
"nbformat_minor": 2
151+
}

0 commit comments

Comments
 (0)