Sphinx extension for self-hosted fonts via Fontsource CDN
Project description
sphinx-fonts
Sphinx extension for self-hosted fonts via Fontsource CDN.
Downloads font files at build time, caches them locally (~/.cache/sphinx-fonts), and
injects @font-face declarations via Jinja2 template context.
Install
$ pip install sphinx-fonts
Usage
In your docs/conf.py:
extensions = ["sphinx_fonts"]
sphinx_fonts = [
{
"family": "IBM Plex Sans",
"package": "@fontsource/ibm-plex-sans",
"version": "5.2.8",
"weights": [400, 500, 600, 700],
"styles": ["normal", "italic"],
"subset": "latin",
},
]
sphinx_font_css_variables = {
"--font-stack": '"IBM Plex Sans", sans-serif',
}
Requires a page.html template override that reads the font_faces and
font_preload_hrefs context variables. See the
gp-sphinx docs for a complete template example.
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_fonts-0.0.1a31.tar.gz.
File metadata
- Download URL: sphinx_fonts-0.0.1a31.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9264a7d511796302b27b7727d1553ffc69cfe3f5bfb8e32e0308880d7b9471f0
|
|
| MD5 |
1663c027c83c8750e643a08a87de24d1
|
|
| BLAKE2b-256 |
fdc1dbce2c627aa219432b7495e96e5fef65de2930f5a58d570b31c88a1e33b8
|
Provenance
The following attestation bundles were made for sphinx_fonts-0.0.1a31.tar.gz:
Publisher:
release.yml on git-pull/gp-sphinx
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sphinx_fonts-0.0.1a31.tar.gz -
Subject digest:
9264a7d511796302b27b7727d1553ffc69cfe3f5bfb8e32e0308880d7b9471f0 - Sigstore transparency entry: 1831004085
- Sigstore integration time:
-
Permalink:
git-pull/gp-sphinx@c6283de0e075cfe1deb76596e398d258a71b0b3d -
Branch / Tag:
refs/tags/v0.0.1a31 - Owner: https://github.com/git-pull
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c6283de0e075cfe1deb76596e398d258a71b0b3d -
Trigger Event:
push
-
Statement type:
File details
Details for the file sphinx_fonts-0.0.1a31-py3-none-any.whl.
File metadata
- Download URL: sphinx_fonts-0.0.1a31-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7176f0c5092873d75a1904d477e6a6a1995b2fdab9d1aa1feaf38afa896fe501
|
|
| MD5 |
211173a1b3a92bcae768a2f82f593632
|
|
| BLAKE2b-256 |
a16ae8bd1bec0334cf8ac07624a04c2a252d38474bf984567cd742aa5d3b250e
|
Provenance
The following attestation bundles were made for sphinx_fonts-0.0.1a31-py3-none-any.whl:
Publisher:
release.yml on git-pull/gp-sphinx
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sphinx_fonts-0.0.1a31-py3-none-any.whl -
Subject digest:
7176f0c5092873d75a1904d477e6a6a1995b2fdab9d1aa1feaf38afa896fe501 - Sigstore transparency entry: 1831006542
- Sigstore integration time:
-
Permalink:
git-pull/gp-sphinx@c6283de0e075cfe1deb76596e398d258a71b0b3d -
Branch / Tag:
refs/tags/v0.0.1a31 - Owner: https://github.com/git-pull
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c6283de0e075cfe1deb76596e398d258a71b0b3d -
Trigger Event:
push
-
Statement type: