Skip to content

Commit ee8f6db

Browse files
authored
fix: Update/Release for Quarto v1.2 (#6)
Fixes #5
1 parent 090f533 commit ee8f6db

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

_extensions/iconify/_extension.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
title: Iconify support
22
author: Mickaël Canouil
3-
version: 0.3.0
3+
version: 1.0.0
4+
quarto-required: ">=1.2.280"
45
contributes:
56
shortcodes:
67
- iconify.lua

_extensions/iconify/iconify.lua

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
local function ensureHtmlDeps()
2-
quarto.doc.addHtmlDependency({
1+
local function ensure_html_deps()
2+
quarto.doc.add_html_dependency({
33
name = 'iconify',
44
version = '1.0.0-beta.2',
55
scripts = {"iconify-icon.min.js"}
66
})
77
end
88

9-
local function isEmpty(s)
9+
local function is_empty(s)
1010
return s == nil or s == ''
1111
end
1212

13-
local function isValidSize(size)
14-
if isEmpty(size) then
13+
local function is_valid_size(size)
14+
if is_empty(size) then
1515
return ''
1616
end
1717
local size_table = {
@@ -53,8 +53,8 @@ end
5353
return {
5454
["iconify"] = function(args, kwargs)
5555
-- detect html (excluding epub which won't handle fa)
56-
if quarto.doc.isFormat("html:js") then
57-
ensureHtmlDeps()
56+
if quarto.doc.is_format("html:js") then
57+
ensure_html_deps()
5858
local set = "fluent-emoji"
5959
local icon = pandoc.utils.stringify(args[1])
6060
if #args > 1 then
@@ -65,41 +65,41 @@ return {
6565
local attributes = ' icon="' .. set .. ':' .. icon .. '"'
6666
local label = '"Icon ' .. icon .. ' from ' .. set .. ' Iconify.design set."'
6767

68-
local size = isValidSize(pandoc.utils.stringify(kwargs["size"]))
69-
if not isEmpty(size) then
68+
local size = is_valid_size(pandoc.utils.stringify(kwargs["size"]))
69+
if not is_empty(size) then
7070
attributes = attributes .. ' style="' .. size .. '"'
7171
end
7272

7373
local aria_label = pandoc.utils.stringify(kwargs["label"])
74-
if isEmpty(aria_label) then
74+
if is_empty(aria_label) then
7575
aria_label = ' aria-label="' .. label .. '"'
7676
else
7777
attributes = attributes .. aria_label
7878
end
7979
local title = pandoc.utils.stringify(kwargs["title"])
80-
if isEmpty(title) then
80+
if is_empty(title) then
8181
title = ' title="' .. label .. '"'
8282
else
8383
attributes = attributes .. title
8484
end
8585
-- local style = pandoc.utils.stringify(kwargs["style"])
86-
-- if not isEmpty(style) then
86+
-- if not is_empty(style) then
8787
-- local attributes = attributes .. ' style="' .. style .. '"'
8888
-- end
8989
local width = pandoc.utils.stringify(kwargs["width"])
90-
if not isEmpty(width) and isEmpty(size) then
90+
if not is_empty(width) and is_empty(size) then
9191
attributes = attributes .. ' width="' .. width .. '"'
9292
end
9393
local height = pandoc.utils.stringify(kwargs["height"])
94-
if not isEmpty(height) and isEmpty(size) then
94+
if not is_empty(height) and is_empty(size) then
9595
attributes = attributes .. ' height="' .. height .. '"'
9696
end
9797
local flip = pandoc.utils.stringify(kwargs["flip"])
98-
if not isEmpty(flip) then
98+
if not is_empty(flip) then
9999
attributes = attributes .. ' flip="' .. flip.. '"'
100100
end
101101
local rotate = pandoc.utils.stringify(kwargs["rotate"])
102-
if not isEmpty(rotate) then
102+
if not is_empty(rotate) then
103103
attributes = attributes .. ' rotate="' .. rotate .. '"'
104104
end
105105

0 commit comments

Comments
 (0)