diff --git a/README.md b/README.md index a0da4bb..2da5c2e 100644 --- a/README.md +++ b/README.md @@ -40,14 +40,15 @@ You can browse all of the available sets of icons here: ### Iconify Attributes Iconify API provides additional attributes: . -Currently, this extension supports: `width`, `height`, `title`[^2], `label`[^2] (_i.e._, `aria-label`), `flip`, and `rotate`. +Currently, this extension supports: `size`, `width`, `height`, `flip`, `rotate`, `title`[^2], `label`[^2] (_i.e._, `aria-label`), and `inline`[^3]. ``` markdown -{{< iconify >}} -{{< iconify >}} +{{< iconify >}} +{{< iconify >}} ``` [^2]: `title` and `label` takes the following default value: `Icon from Iconify.design set.`. +[^3]: `inline` is a boolean attribute that can be set to `true` or `false`. Default is `true`. ### Sizing Icons diff --git a/_extensions/iconify/_extension.yml b/_extensions/iconify/_extension.yml index bdcb4e1..47e4246 100644 --- a/_extensions/iconify/_extension.yml +++ b/_extensions/iconify/_extension.yml @@ -1,6 +1,6 @@ title: Iconify support author: Mickaƫl Canouil -version: 2.1.1 +version: 2.1.2 quarto-required: ">=1.2.280" contributes: shortcodes: diff --git a/_extensions/iconify/iconify.lua b/_extensions/iconify/iconify.lua index 9979b4d..d5c89a4 100644 --- a/_extensions/iconify/iconify.lua +++ b/_extensions/iconify/iconify.lua @@ -139,9 +139,15 @@ return { attributes = attributes .. ' rotate="' .. rotate .. '"' end + local inline = pandoc.utils.stringify(kwargs["inline"]) + if is_empty(inline) or inline ~= "false" then + attributes = ' inline ' .. attributes + end + + return pandoc.RawInline( 'html', - '' + '' ) else return pandoc.Null() diff --git a/example.qmd b/example.qmd index f999e81..5ff83be 100644 --- a/example.qmd +++ b/example.qmd @@ -12,9 +12,9 @@ It provides an `{{{< iconify >}}}` shortcode: {{{< iconify >}}} ``` -- Optional `` (default is `fluent-emoji`) ``, ``, ``, ``, and ``: +- Optional `` (default is `fluent-emoji`) ``, ``, ``, ``, ``, ``, ``, and ``: ``` markdown - {{{< iconify >}}} + {{{< iconify >}}} ``` If `` is defined, `` and `` are not used. See for more details.