Sphinx Extension adding support for custom favicons
Project description
Sphinx Favicon
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
fromsphinx-favicon
tosphinx_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.
Project details
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
File details
Details for the file sphinx-favicon-1.0.1.tar.gz
.
File metadata
- Download URL: sphinx-favicon-1.0.1.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | df796de32125609c1b4a8964db74270ebf4502089c27cd53f542354dc0b57e8e |
|
MD5 | 211b14a52b5a6dfeaa1669af2825c27d |
|
BLAKE2b-256 | b1253c78b785c3ea991597c310ac6bdc7949c2a7549e031dbb22db4ce8d1b99b |
File details
Details for the file sphinx_favicon-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: sphinx_favicon-1.0.1-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c93d6b634cb4c9687ceab67a8526f05d3b02679df94e273e51a43282e6b034c |
|
MD5 | 6f6833080660405d65ba390b687e4cf6 |
|
BLAKE2b-256 | 92c2152bd6c211b847e525d2c7004fd98e3ac5baeace192716da8cd9c9ec2427 |