Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sphinx_fonts-0.0.1a33.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sphinx_fonts-0.0.1a33-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file sphinx_fonts-0.0.1a33.tar.gz.

File metadata

  • Download URL: sphinx_fonts-0.0.1a33.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

Hashes for sphinx_fonts-0.0.1a33.tar.gz
Algorithm Hash digest
SHA256 f5e8c304086ebda2b739c3f72127d2a1ad88153c8c7b59b03b1a015b8e072847
MD5 10164821f5f183a6a1a2b176d85e0e6a
BLAKE2b-256 6497dae5e823ab8474828f870bfdf2bc6003448beec1365e42391ce9fc55615c

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinx_fonts-0.0.1a33.tar.gz:

Publisher: release.yml on git-pull/gp-sphinx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sphinx_fonts-0.0.1a33-py3-none-any.whl.

File metadata

File hashes

Hashes for sphinx_fonts-0.0.1a33-py3-none-any.whl
Algorithm Hash digest
SHA256 4eaa49f30bfa3e2705a6fe7f73865840e6fc387e69a8cb9872543e86ac3ed111
MD5 1ee8d0e1aa654c1bbe1a25a3d4248389
BLAKE2b-256 de2dd5526216ce75d361f9aebd6bc052e0dd1b200870bc0e082468d22a38b65f

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinx_fonts-0.0.1a33-py3-none-any.whl:

Publisher: release.yml on git-pull/gp-sphinx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page