Skip to content

Commit 88cb89f

Browse files
authored
Merge branch 'executablebooks:master' into main
2 parents a4b490b + 56874cb commit 88cb89f

32 files changed

Lines changed: 648 additions & 418 deletions

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
python -m build
2929
3030
- name: Publish
31-
uses: pypa/gh-action-pypi-publish@v1.10.0
31+
uses: pypa/gh-action-pypi-publish@v1.12.2
3232
with:
3333
user: __token__
3434
password: ${{ secrets.PYPI_KEY }}

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
# Disabled for now with false &&
7575
- name: Upload to Codecov
7676
if: false && matrix.os == 'ubuntu-latest' && matrix.python-version == 3.9 && matrix.sphinx == '~=7.0' && github.repository == 'executablebooks/sphinx-book-theme' && github.event_name == 'pull_request'
77-
uses: codecov/codecov-action@v3.1.4
77+
uses: codecov/codecov-action@v5.0.7
7878
with:
7979
name: ebp-sbt-pytests-py3.7
8080
flags: pytests
@@ -124,7 +124,7 @@ jobs:
124124
assert len(unexpected) == 0, unexpected
125125
126126
- name: Audit with Lighthouse
127-
uses: treosh/lighthouse-ci-action@10.1.0
127+
uses: treosh/lighthouse-ci-action@12.1.0
128128
with:
129129
configPath: ".github/workflows/lighthouserc.json"
130130
temporaryPublicStorage: true

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ repos:
2424
- id: trailing-whitespace
2525

2626
- repo: https://github.com/astral-sh/ruff-pre-commit
27-
rev: v0.7.4
27+
rev: v0.8.4
2828
hooks:
2929
- id: ruff
3030
args: ["--fix", "--show-fixes"]

.readthedocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ python:
1313

1414
sphinx:
1515
builder: html
16+
configuration: docs/conf.py

docs/conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
import os
33
from urllib.request import urlopen
44
from pathlib import Path
5+
from datetime import datetime
56

67
project = "Sphinx Book Theme"
7-
copyright = "2023"
8+
copyright = str(datetime.now().year)
89
author = "the Executable Book Project"
910
# language = "fr" # For testing language translations
1011
language = "zh_CN"

docs/content/launch.md

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
# Launch buttons for interactivity
33

44
You can automatically add buttons that allow users to interact with your
5-
book's content. This is either by directing them to a BinderHub or JupyterHub
6-
that runs in the cloud, or by making your page interactive using Thebe.
5+
book's content. This is can be by directing them to
6+
a [JupyterLite](https://jupyterlite.readthedocs.io) installation (that runs in
7+
the user's browser) or one of BinderHub or JupyterHub (that runs in the
8+
cloud), or by making your page interactive using Thebe.
79

8-
To use either Binder or JupyterHub links, you'll first need to configure your
9-
documentation's repository url:
10+
To use any of JupyterLite or Binder or JupyterHub links, you'll first need to
11+
configure your documentation's repository url:
1012

1113
```python
1214
html_theme_options = {
@@ -26,6 +28,28 @@ folder as your content, then Binder/JupyterHub links will point to the ipynb
2628
file instead of the text file.
2729
```
2830

31+
## JupyterLite
32+
33+
If you are adding [JupyterLite](https://github.com/jupyterlite/jupyterlite) links to your page, first work out where your
34+
JupyterLite instance will be serving from, then add the URL to your
35+
configuration. In the example below, we've set up JupyterLite pages at the
36+
base URL of the main pages site, and at subdirectory `interact/lab`:
37+
38+
```python
39+
html_theme_options = {
40+
...
41+
"launch_buttons": {
42+
"jupyterlite_url": "interact/lab/index.html"
43+
},
44+
...
45+
}
46+
```
47+
48+
See <https://odsti.github.io/cfd-textbook> for an example
49+
[JupyterBook](https://jupyterbook.org) project serving JupyterLite using this
50+
configuration, and <https://github.com/odsti/cfd-textbook> for the driving
51+
repository.
52+
2953
## Binder / BinderHub
3054

3155
To add Binder links to your page, add the following configuration:

docs/content/notebooks.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ print("this works for code cells too, if you add a `margin` tag to them")
115115
```{code-cell} ipython3
116116
# You can also include enriched outputs like Math
117117
from IPython.display import Math
118-
Math("\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}")
118+
Math(r"\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}")
119119
```
120120

121121
## Removing content before publishing
@@ -171,6 +171,7 @@ See [the Pandas Styling docs](https://pandas.pydata.org/pandas-docs/stable/user_
171171
:tags: [hide-input]
172172
173173
import pandas as pd
174+
from pandas.io.formats.style import Styler
174175
175176
np.random.seed(24)
176177
df = pd.DataFrame({'A': np.linspace(1, 10, 10)})
@@ -195,8 +196,8 @@ def highlight_max(s):
195196
is_max = s == s.max()
196197
return ['background-color: yellow' if v else '' for v in is_max]
197198
198-
df.style.\
199-
applymap(color_negative_red).\
199+
Styler(df, uuid="1").\
200+
map(color_negative_red).\
200201
apply(highlight_max).\
201202
set_table_attributes('style="font-size: 10px"')
202203
```

docs/reference/kitchen-sink/generic.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Licensed under Creative Commons Attribution-ShareAlike 4.0 International License
44
SPDX-License-Identifier: CC-BY-SA-4.0
55
6-
.. |EXAMPLE| image:: https://source.unsplash.com/32x32/daily?icon
6+
.. |EXAMPLE| image:: https://jupyter.org/assets/logos/rectanglelogo-greytext-orangebody-greymoons.svg
77
:width: 1em
88

99
=============
@@ -110,7 +110,7 @@ Sidebar
110110

111111
Lorem ipsum dolor sit amet consectetur adipisicing elit.
112112

113-
.. image:: https://source.unsplash.com/200x200/daily?cute+puppy
113+
.. image:: https://jupyter.org/assets/logos/rectanglelogo-greytext-orangebody-greymoons.svg
114114

115115
Lorem ipsum dolor sit amet consectetur adipisicing elit.
116116

@@ -268,4 +268,4 @@ voluptatem officia culpa optio atque. Quaerat sed quibusdam ratione nam.
268268
Download Links
269269
==============
270270

271-
:download:`This long long long long long long long long long long long long long long long download link should wrap white-spaces <https://source.unsplash.com/200x200/daily?cute+puppy>`
271+
:download:`This long long long long long long long long long long long long long long long download link should wrap white-spaces <https://jupyter.org/assets/logos/rectanglelogo-greytext-orangebody-greymoons.svg>`

docs/reference/kitchen-sink/images.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ Images
1212

1313
An image:
1414

15-
.. image:: https://source.unsplash.com/200x200/daily?cute+puppy
15+
.. image:: https://jupyter.org/assets/logos/rectanglelogo-greytext-orangebody-greymoons.svg
1616
:height: 200
1717
:width: 200
1818

1919
A clickable image:
2020

21-
.. image:: https://source.unsplash.com/200x200/daily?cute+puppy
22-
:target: https://unsplash.com/
21+
.. image:: https://jupyter.org/assets/logos/rectanglelogo-greytext-orangebody-greymoons.svg
22+
:target: https://jupyter.org/
2323
:height: 200
2424
:width: 200
2525

26-
.. image:: https://source.unsplash.com/200x200/daily?cute+puppy
26+
.. image:: https://jupyter.org/assets/logos/rectanglelogo-greytext-orangebody-greymoons.svg
2727
:align: right
2828
:height: 200
2929
:width: 200
@@ -43,7 +43,7 @@ sapiente veritatis doloribus accusantium molestiae modi recusandae
4343
excepturi facere, corrupti expedita sit nihil temporibus eius sequi
4444
animi, illo libero labore fuga.
4545

46-
.. image:: https://source.unsplash.com/200x200/daily?cute+puppy
46+
.. image:: https://jupyter.org/assets/logos/rectanglelogo-greytext-orangebody-greymoons.svg
4747
:align: left
4848
:height: 200
4949
:width: 200
@@ -66,7 +66,7 @@ animi, illo libero labore fuga.
6666
Figures
6767
-------
6868

69-
.. figure:: https://source.unsplash.com/200x200/daily?cute+puppy
69+
.. figure:: https://jupyter.org/assets/logos/rectanglelogo-greytext-orangebody-greymoons.svg
7070
:alt: reStructuredText, the markup syntax
7171

7272
A figure is an image with a caption and/or a legend:
@@ -83,7 +83,7 @@ Figures
8383

8484
A figure directive with center alignment
8585

86-
.. figure:: https://source.unsplash.com/200x200/daily?cute+puppy
86+
.. figure:: https://jupyter.org/assets/logos/rectanglelogo-greytext-orangebody-greymoons.svg
8787
:align: center
8888

8989
This caption should be centered.

docs/reference/kitchen-sink/lists.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,11 +246,11 @@ Hlists
246246
.. hlist::
247247
:columns: 2
248248

249-
- .. figure:: https://source.unsplash.com/200x200/daily?cute+puppy
249+
- .. figure:: https://jupyter.org/assets/logos/rectanglelogo-greytext-orangebody-greymoons.svg
250250

251251
This is a short caption for a figure.
252252

253-
- .. figure:: https://source.unsplash.com/200x200/daily?cute+puppy
253+
- .. figure:: https://jupyter.org/assets/logos/rectanglelogo-greytext-orangebody-greymoons.svg
254254

255255
This is a long caption for a figure. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
256256
Donec porttitor dolor in odio posuere, vitae ornare libero mattis. In lobortis justo vestibulum nibh aliquet, non.

0 commit comments

Comments
 (0)