A collection of useful Jupyter Book v1 patches.
Project description
Sphinx extension: JupyterBook-Patches
This Sphinx extension fixes:
- with a
layoutpatch:- an issue where drop down menus would still take up space after being minimized, and the patch fixes it through some css.
- an issue where in drop down code cells the shown summary remained lightgray instead of turning darkgrey. Fix through css.
- an issue where the size of code in a header is not the correct font size. Fix through css.
- an issue where the sidebar shows a scrollbar even if that's not needed
- an issue where the margin causes a scroll bar for a window between 992 and 1200px.
- an issue where the caption text of a figure is aligned on the left for multi-line caption text
- with a
buttonpatch:- an issue where two buttons for interactive matplotlib widget do not appear.
- with a
mathjaxpatch:- an issue where in the Firefox browser the CHTML renderer of MathJax does not render thin lines consistently. Fixed by selecting the SVG renderer only for the Firefox browser.
- an issue where rendered MathJax using the CHTML renderer is sometimes clipped at the top and/or the right. Fixed by adding some css to improve the appearance of MathJax elements.
- that makes the default loading method of MathJax to be lazy loading, which improves page load times. Can be disabled if needed by either
- disabling the
mathjaxpatch (this also disables the Firefox fix); or - adding
ui/nonlazytoconfig.mathjax3_config['loader']['load']in your config file as shown below. This value is not defined by MathJax, but introduced by JupyterBook-Patches to allow disabling lazy loading.sphinx: config: mathjax3_config: loader: load: - "ui/nonlazy"
- disabling the
- with a
downloadpatch:- an issue where the standard download button for downloading
.ipynband.mdfiles opens a new tab in some browsers instead of downloading the file. Fixed by adding thedownloadattribute to the download links.
- an issue where the standard download button for downloading
- with a
hashpatch:- an issue where if the URL contains a specific element id, the page scrolls to the element on the initial/partial page load and does not scroll to that element after complete page load. Fixed by adding a small javascript that scrolls to the element after complete page load.
Installation
To install the Sphinx-JupyterBook-Patches, follow these steps:
Step 1: Install the Package
Install the jupyterbook_patches package using pip:
pip install jupyterbook_patches
Step 2: Add to requirements.txt
Make sure that the package is included in your project's requirements.txt to track the dependency:
jupyterbook_patches
Step 3: Enable in _config.yml
In your _config.yml file, add the extension to the list of Sphinx extra extensions:
sphinx:
extra_extensions:
- jupyterbook_patches
Step 4 (optional): Disable patches in _config.yml
In your _config.yml file, add disable patches you do not wish:
sphinx:
config:
patch_config:
disabled-patches: []
Replace [] by a list of strings to disable patches. Use the patch name as indicated at the top of this document.
For example, to disable the mathjax patch:
sphinx:
config:
patch_config:
disabled-patches: ["mathjax"]
For example, to disable the layout and button patches:
sphinx:
config:
patch_config:
disabled-patches: ["button","layout"]
Part of TeachBooks Favourites
This extension is part of TeachBooks Favourites, a Sphinx extension which collects all of TeachBooks' favourite features in one place.
Contribute
This tool's repository is stored on GitHub. The README.md of the branch manual_docs is also part of the TeachBooks manual as a submodule. If you'd like to contribute, you can create a fork and open a pull request on the GitHub repository. To update the README.md shown in the TeachBooks manual, create a fork and open a merge request for the GitHub repository of the manual. If you intent to clone the manual including its submodules, clone using: git clone --recurse-submodulesgit@github.com:TeachBooks/manual.git.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jupyterbook_patches-1.11.3.tar.gz.
File metadata
- Download URL: jupyterbook_patches-1.11.3.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa11b6178b2e881ca7d0bfbb8d915c2aaefc4dba8f4988a85f5ee03c22c90745
|
|
| MD5 |
1b23903159ac053a7ed26751ba155020
|
|
| BLAKE2b-256 |
71c83510b360b3e1fa3a2c2b2472d46119cd7a6b1a8682c94240d0e6c6587117
|
Provenance
The following attestation bundles were made for jupyterbook_patches-1.11.3.tar.gz:
Publisher:
python-publish.yml on TeachBooks/JupyterBook-Patches
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jupyterbook_patches-1.11.3.tar.gz -
Subject digest:
aa11b6178b2e881ca7d0bfbb8d915c2aaefc4dba8f4988a85f5ee03c22c90745 - Sigstore transparency entry: 743118899
- Sigstore integration time:
-
Permalink:
TeachBooks/JupyterBook-Patches@d3df5ac491f87c344067559686d1e9222c8463eb -
Branch / Tag:
refs/tags/v1.11.3 - Owner: https://github.com/TeachBooks
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@d3df5ac491f87c344067559686d1e9222c8463eb -
Trigger Event:
push
-
Statement type:
File details
Details for the file jupyterbook_patches-1.11.3-py3-none-any.whl.
File metadata
- Download URL: jupyterbook_patches-1.11.3-py3-none-any.whl
- Upload date:
- Size: 13.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d7565e606e15a990218ef71809fa5fa3967ac2df78e6f22724c0cb9468ac7ad
|
|
| MD5 |
061835c35dbadd65a4991613b58820fe
|
|
| BLAKE2b-256 |
da7d46adc87e1879d61327eeb7ff2b35eb07bd9a4d8c5b158ddbba6d0391686e
|
Provenance
The following attestation bundles were made for jupyterbook_patches-1.11.3-py3-none-any.whl:
Publisher:
python-publish.yml on TeachBooks/JupyterBook-Patches
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jupyterbook_patches-1.11.3-py3-none-any.whl -
Subject digest:
0d7565e606e15a990218ef71809fa5fa3967ac2df78e6f22724c0cb9468ac7ad - Sigstore transparency entry: 743118906
- Sigstore integration time:
-
Permalink:
TeachBooks/JupyterBook-Patches@d3df5ac491f87c344067559686d1e9222c8463eb -
Branch / Tag:
refs/tags/v1.11.3 - Owner: https://github.com/TeachBooks
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@d3df5ac491f87c344067559686d1e9222c8463eb -
Trigger Event:
push
-
Statement type: