File tree Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Original file line number Diff line number Diff line change 2
2
example_files /
3
3
example.html
4
4
/ding.mp3
5
+
6
+ /.luarc.json
Original file line number Diff line number Diff line change 1
1
title : Elevator.js
2
2
author : Mickaël Canouil
3
- version : 0.1.0
3
+ version : 1.0.0
4
+ quarto-required : " >=1.2.280"
4
5
contributes :
5
6
shortcodes :
6
7
- elevator.lua
Original file line number Diff line number Diff line change 1
- local function ensureHtmlDeps ()
2
- quarto .doc .addHtmlDependency ({
1
+ local function ensure_html_deps ()
2
+ quarto .doc .add_html_dependency ({
3
3
name = ' elevatorjs' ,
4
4
version = ' 1.0.0' ,
5
5
scripts = {" elevator.min.js" }
6
6
})
7
7
end
8
8
9
- local function isEmpty (s )
9
+ local function is_empty (s )
10
10
return s == ' ' or s == nil
11
11
end
12
12
13
13
return {
14
14
[" 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 ()
17
17
18
18
local textButton = ' Return to the top!'
19
19
local targetAnchor = ' '
@@ -25,14 +25,14 @@ return {
25
25
end
26
26
27
27
mainAudio = pandoc .utils .stringify (kwargs [" audio" ])
28
- if isEmpty (mainAudio ) then
28
+ if is_empty (mainAudio ) then
29
29
mainAudio = ' '
30
30
end
31
31
32
32
endAudio = pandoc .utils .stringify (kwargs [" end" ])
33
- if isEmpty (endAudio ) then
33
+ if is_empty (endAudio ) then
34
34
endAudio = " ding.mp3"
35
- quarto .doc .addFormatResource (endAudio )
35
+ quarto .doc .add_format_resource (endAudio )
36
36
end
37
37
38
38
return pandoc .RawInline (
You can’t perform that action at this time.
0 commit comments