Skip to main content

Sphinx Favicon

License: MIT Black badge PyPI PyPI - Python Version GitHub Workflow Status Read the Docs (version)

Note: Updating from Version 0.2 to Version 1.0

Between v0.2 and v1.0, the module name of the extension changed to better conform with Python standards. Please update the name used in the extension list of your conf.py from sphinx-favicon to sphinx_favicon!

A Sphinx extension to add custom favicons

With Sphinx Favicon, you can add custom favicons to your Sphinx html documentation quickly and easily.

You can define favicons directly in your conf.py, with different rel attributes such as "icon" or "apple-touch-icon" and any favicon size.

The Sphinx Favicon extension gives you more flexibility than the standard favicon.ico supported by Sphinx. It provides a quick and easy way to add the most important favicon formats for different browsers and devices.

Installation

Use pip to install Sphinx Favicon in your environment:

pip install sphinx-favicon

Usage

After installing sphinx-favicon, add it to your conf.py extension list:

extensions = ["sphinx_favicon"]

Then configure the favicon links using the favicons parameter (html_static_path is mandatory if you use relative path):

html_static_path = ["_static"]

favicons = [
    {"href": "icon.svg"},  # => use `_static/icon.svg`
    {"href": "https://secure.example.com/favicon/favicon-16x16.png"},
    {"href": "https://secure.example.com/favicon/favicon-32x32.png"},
    {
        "rel": "apple-touch-icon",
        "href": "https://secure.example.com/favicon/apple-touch-icon-180x180.png",
    },
]

Based on this configuration, Sphinx will include the following favicon information in the HTML <head> element:

<link rel="icon" href="_static/icon.svg" type="image/svg+xml">
<link rel="icon" href="https://secure.example.com/favicon/favicon-16x16.png" sizes="16x16" type="image/png">
<link rel="icon" href="https://secure.example.com/favicon/favicon-32x32.png" sizes="32x32" type="image/png">
<link rel="apple-touch-icon" href="https://secure.example.com/favicon/apple-touch-icon-180x180.png" sizes="180x180" type="image/png">

For more details and more advanced usage, please see the documentation.

Contribution

Contributions of any kind are welcome. Please see the contribution section of our documentation for more information.

Download files

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

Source Distribution

sphinx-favicon-1.0.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

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

sphinx_favicon-1.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file sphinx-favicon-1.0.tar.gz.

File metadata

  • Download URL: sphinx-favicon-1.0.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for sphinx-favicon-1.0.tar.gz
Algorithm Hash digest
SHA256 d603440ce934ca04128937c46db42a743c8e2931f4b57509b45a0e1107864fa2
MD5 db73b7d292ec203dc1623974b980a47e
BLAKE2b-256 9df721a5512e5682a3cfdfe6d77e5b82c640984185ff51cd5b220c42c50df8d0

See more details on using hashes here.

File details

Details for the file sphinx_favicon-1.0-py3-none-any.whl.

File metadata

  • Download URL: sphinx_favicon-1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for sphinx_favicon-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0f956e27545da183af3c967c06c27bf9ce14bfdce4911dfd3b29295f9da59a9e
MD5 44b01804b8a7e7ab4e02465146cfcfcf
BLAKE2b-256 bc4401dad4653f7a9abd2a763bb6e5f9adb0bda566741964dc1f94f1cdb2f8c6

See more details on using hashes here.

Release history Release notifications | RSS feed

1.1.0

2 files

1.0.1

2 files

This release

1.0 This release

2 files

0.2

2 files

0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page