Skip to content

Commit e252d7f

Browse files
committed
use new style quarto api functions
1 parent a5acccc commit e252d7f

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
/.luarc.json
2+
/example.html
3+
/example_files/
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
title: Lightbox
22
author: RStudio, PBC
33
version: 0.1.4
4+
quarto-required: ">=1.2.198"
45
contributes:
56
filters:
67
- lightbox.lua

_extensions/quarto-ext/lightbox/lightbox.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ return {
9898
},
9999
{
100100
Image = function(imgEl)
101-
if quarto.doc.isFormat("html:js") then
101+
if quarto.doc.is_format("html:js") then
102102
local isAlreadyLinked = imagesWithinLinks:includes(imgEl)
103103
if (not isAlreadyLinked and auto and not imgEl.classes:includes(kNoLightboxClass))
104104
or imgEl.classes:includes('lightbox') then
@@ -161,7 +161,7 @@ return {
161161
-- we need to include the dependencies
162162
if needsLightbox then
163163
-- add the dependency
164-
quarto.doc.addHtmlDependency({
164+
quarto.doc.add_html_dependency({
165165
name = 'glightbox',
166166
scripts = {'resources/js/glightbox.min.js'},
167167
stylesheets = {'resources/css/glightbox.min.css', 'lightbox.css'}
@@ -230,7 +230,7 @@ return {
230230
local scriptTag = "<script>var lightboxQuarto = GLightbox(" .. optionsJson .. ");</script>"
231231

232232
-- inject the rendering code
233-
quarto.doc.includeText("after-body", scriptTag)
233+
quarto.doc.include_text("after-body", scriptTag)
234234

235235
end
236236
end

example.qmd

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ title: Example Lightbox Document
33
filters:
44
- lightbox
55
lightbox: auto
6-
keep-md: true
76
---
87

98
## Chilmark

0 commit comments

Comments
 (0)