Skip to content

Commit 9c5a199

Browse files
authored
fix: Update/Release for Quarto v1.2 (#2)
Fixes #1
1 parent 9a89f53 commit 9c5a199

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
example_files/
33
example.html
44
/ding.mp3
5+
6+
/.luarc.json
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
title: Elevator.js
22
author: Mickaël Canouil
3-
version: 0.1.0
3+
version: 1.0.0
4+
quarto-required: ">=1.2.280"
45
contributes:
56
shortcodes:
67
- elevator.lua

_extensions/elevator/elevator.lua

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

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

1313
return {
1414
["elevator"] = function(args, kwargs)
15-
if quarto.doc.isFormat("html:js") then
16-
ensureHtmlDeps()
15+
if quarto.doc.is_format("html:js") then
16+
ensure_html_deps()
1717

1818
local textButton = 'Return to the top!'
1919
local targetAnchor = ''
@@ -25,14 +25,14 @@ return {
2525
end
2626

2727
mainAudio = pandoc.utils.stringify(kwargs["audio"])
28-
if isEmpty(mainAudio) then
28+
if is_empty(mainAudio) then
2929
mainAudio = ''
3030
end
3131

3232
endAudio = pandoc.utils.stringify(kwargs["end"])
33-
if isEmpty(endAudio) then
33+
if is_empty(endAudio) then
3434
endAudio = "ding.mp3"
35-
quarto.doc.addFormatResource(endAudio)
35+
quarto.doc.add_format_resource(endAudio)
3636
end
3737

3838
return pandoc.RawInline(

0 commit comments

Comments
 (0)