mcanouil / quarto-iconify

Use Iconify icons in HTML-based Quarto documents (over 200,000 open source vector icons)
https://m.canouil.dev/quarto-iconify/
MIT License
88 stars 0 forks source link
iconify icons quarto quarto-extension quarto-pub quarto-shortcode quartopub

Iconify Extension for Quarto

This extension provides support to free and open source icons provided by Iconify.
Icons can be used only in HTML-based documents.

Installing

quarto add mcanouil/quarto-iconify

This will install the extension under the _extensions subdirectory.
If you're using version control, you will want to check in this directory.

Using

To embed an icon, use the {{< iconify >}} shortcode[^1]. For example:

{{< iconify exploding-head >}}
{{< iconify fluent-emoji exploding-head >}}
{{< iconify fluent-emoji:exploding-head >}}
{{< iconify exploding-head size=2xl >}}
{{< iconify exploding-head size=5x rotate=180deg >}}
{{< iconify exploding-head size=Huge >}}
{{< iconify fluent-emoji-high-contrast 1st-place-medal >}}
{{< iconify twemoji 1st-place-medal >}}
{{< iconify line-md loading-alt-loop >}}
{{< iconify fa6-brands apple width=50px height=10px rotate=90deg flip=vertical >}}
{{< iconify simple-icons:quarto >}}

This extension includes support for thousands of icons (including animated icons). You can browse all of the available sets of icons here:

https://icon-sets.iconify.design/

[^1]: The default icon set is fluent-emoji (source: https://github.com/microsoft/fluentui-emoji).

Iconify Attributes

Iconify API provides additional attributes: https://docs.iconify.design/iconify-icon/.
Currently, this extension supports: width, height, title[^2], label[^2] (i.e., aria-label), flip, and rotate.

{{< iconify <set> <icon> <size=...> <width=...> <height=...> <flip=...> <rotate=...> <title=...> <label=...> >}}
{{< iconify <set:icon> <size=...> <width=...> <height=...> <flip=...> <rotate=...> <title=...> <label=...> >}}

[^2]: title and label takes the following default value: Icon <icon> from <set> Iconify.design set..

Sizing Icons

This extension provides relative, literal, and LaTeX-style sizing for icons.
When the size is invalid, no size changes are made.

Example

Here is the source code for a minimal example: example.qmd.

This is the output of example.qmd for HTML.


Iconify by Vjacheslav Trushkin under MIT License.