Sphinx Iconify

Embedding icons from over 200,000 open-source vector icons.


sphinx-iconify provides the :iconify: role, which allows you to use the <iconify-icon> web component powered by Iconify.

Install

sphinx-iconify is conveniently available as a Python package on PyPI and can be easily installed using pip and uv.

pip install sphinx-iconify
uv add --dev sphinx-iconify

Add sphinx_iconify to your docs/conf.py:

docs/conf.py
extensions = [
    'sphinx_iconify',
]

Usage

Using the role iconify to embed an icon:

{iconify}`devicon:pypi`
:iconify:`devicon:pypi`

It is also possible to add extra attributes to the icon:

{iconify}`devicon:pypi width=48px height=48px`
:iconify:`devicon:pypi width=48px height=48px`

Icon sets

You can find all the available icons on https://icon-sets.iconify.design/.

Configuration

Besides adding sphinx_iconify to your docs/conf.py, there is also a iconify_script_url setting. The default value is:

https://code.iconify.design/iconify-icon/3.0.0/iconify-icon.min.js

When using shibuya theme, you can set the value to empty, because shibuya theme has built-in <iconify-icon> web component.

docs/conf.py
extensions = [
    "sphinx_iconify",
]
iconify_script_url = ""
html_theme = "shibuya"

License

BSD