A custom Sphinx extension to apply TU Delft styling to a TeachBook
Project description
Sphinx extension: TU Delft theme
Introduction
The default theme in JupyterBooks is usually not desired and need to be changed by adding custom stylesheets. The Sphinx-TUDelft-theme extension provides a simple solution to have a uniform theme across all the books created at Delft University of Technology that matches the TU Delft identity.
What does it do?
This extension applies styling changes, being
- particular colours for:
- admonitions (e.g. hint, note, tip, error, etc.),
- proofs (e.g. theorem, axiom, lemma, corollary, etc.),
- exercises,
- buttons,
- badges,
- custom components.
- particular icons for:
- proofs (e.g. theorem, axiom, lemma, corollary, etc.),
- exercises,
- custom components.
Unless specified otherwise, see Usage, this extension also automatically sets:
- a Delft University of Technology logo;
- a Delft University of Technology favicon;
- the Delft University of Technology preferred fonts;
- rendering text inside MathJax as the surrounding text;
- an always visible logo (i.e. a sticky logo).
You can see how the TU Delft theme looks like applied in this example book.
Installation
To implement the TU Delft theme, follow these steps:
Step 1: Install the Package
Install the sphinx-tudelft-theme package using pip:
pip install sphinx-tudelft-theme
Step 2: Add to requirements.txt
Make sure that the package is included in your project's requirements.txt to track the dependency:
sphinx-tudelft-theme
Step 3: Enable in _config.yml
In your _config.yml file, add the extension to the list of Sphinx extra extensions (important: underscore, not dash this time):
sphinx:
extra_extensions:
- sphinx_tudelft_theme
Usage
By following the steps above, the theme will be applied automatically. To see the examples of usage visit the TeachBooks manual.
If a Delft University of Technology logo should not be set (i.e. use logos defined by the user), include the following in your _config.yml file:
sphinx:
config:
...
tud_change_logo: false
If a Delft University of Technology favicon should not be set (i.e. use a favicon defined by the user), include the following in your _config.yml file:
sphinx:
config:
...
tud_change_favicon: false
If the Delft University of Technology fonts should not be set (i.e. use fonts defined by the user), include the following in your _config.yml file:
sphinx:
config:
...
tud_change_fonts: false
If rendering text inside MathJax should not be the same as the surrounding html, include the following in your _config.yml file:
sphinx:
config:
...
tud_change_mtext: false
If a sticky logo is not preferred, include the following in your _config.yml file:
sphinx:
config:
...
tud_sticky_logo: false
Contribute
This tool's repository is stored on GitHub. The README.md of the branch Manual 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 sphinx_tudelft_theme-1.0.0.tar.gz.
File metadata
- Download URL: sphinx_tudelft_theme-1.0.0.tar.gz
- Upload date:
- Size: 186.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
639b15ee44e8970b03c85f417efd97e2453c5eecf98b693e3006129c8c056cdc
|
|
| MD5 |
2a8c2792d3354eb6c373cf425baef42e
|
|
| BLAKE2b-256 |
ff9c44a5090dd58b7392957d0d582f9f448b8f77a2640a3f3af51483c9032eb9
|
Provenance
The following attestation bundles were made for sphinx_tudelft_theme-1.0.0.tar.gz:
Publisher:
python-publish.yml on TeachBooks/Sphinx-TUDelft-theme
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sphinx_tudelft_theme-1.0.0.tar.gz -
Subject digest:
639b15ee44e8970b03c85f417efd97e2453c5eecf98b693e3006129c8c056cdc - Sigstore transparency entry: 157015200
- Sigstore integration time:
-
Permalink:
TeachBooks/Sphinx-TUDelft-theme@dd5b77502c3e08f1e0feb939b502ca11dcd2e32c -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/TeachBooks
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@dd5b77502c3e08f1e0feb939b502ca11dcd2e32c -
Trigger Event:
push
-
Statement type:
File details
Details for the file sphinx_tudelft_theme-1.0.0-py3-none-any.whl.
File metadata
- Download URL: sphinx_tudelft_theme-1.0.0-py3-none-any.whl
- Upload date:
- Size: 183.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5908555872a2fce98f0a9a17a5802b515f23dccf2cc9890247be0b7d2bed86e4
|
|
| MD5 |
a051388800a7ca2ae87bae2aa2d6afe5
|
|
| BLAKE2b-256 |
565446346334aee7b1d277f357b551d363c8388934625ca5c607180cde34e7e6
|
Provenance
The following attestation bundles were made for sphinx_tudelft_theme-1.0.0-py3-none-any.whl:
Publisher:
python-publish.yml on TeachBooks/Sphinx-TUDelft-theme
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sphinx_tudelft_theme-1.0.0-py3-none-any.whl -
Subject digest:
5908555872a2fce98f0a9a17a5802b515f23dccf2cc9890247be0b7d2bed86e4 - Sigstore transparency entry: 157015201
- Sigstore integration time:
-
Permalink:
TeachBooks/Sphinx-TUDelft-theme@dd5b77502c3e08f1e0feb939b502ca11dcd2e32c -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/TeachBooks
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@dd5b77502c3e08f1e0feb939b502ca11dcd2e32c -
Trigger Event:
push
-
Statement type: