Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clean scaffold lua API #9489

Open
cderv opened this issue Apr 25, 2024 · 0 comments
Open

clean scaffold lua API #9489

cderv opened this issue Apr 25, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request lua Issues related to the lua codebase, filter chain, etc pandoc-lua Issues with our Lua helper functions, filters, etc. in Pandoc

Comments

@cderv
Copy link
Collaborator

cderv commented Apr 25, 2024

We have two functions, one of them adding the "hidden" class - but we are unsure of why

-- wrap an element with another element containing the quarto-scaffold class
-- so that it will be stripped out in the final output
scaffold_element = function(node)
local pt = pandoc.utils.type(node)
if pt == "Blocks" then
return pandoc.Div(node, {"", {"quarto-scaffold"}})
elseif pt == "Inlines" then
return pandoc.Span(node, {"", {"quarto-scaffold"}})
else
return node
end
end,
-- a slightly different version of scaffold_element; we should probably unify these
make_scaffold = function(ctor, node)
return ctor(node or {}, pandoc.Attr("", {"quarto-scaffold", "hidden"}, {}))
end,

And also we still have global function

function make_scaffold(ctor, node)
return ctor(node or {}, pandoc.Attr("", {"quarto-scaffold", "hidden"}, {}))
end

Used only once at

local callthm = make_scaffold(pandoc.Div, preamble)

@cderv cderv added pandoc-lua Issues with our Lua helper functions, filters, etc. in Pandoc lua Issues related to the lua codebase, filter chain, etc labels Apr 25, 2024
@mcanouil mcanouil added the enhancement New feature or request label Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request lua Issues related to the lua codebase, filter chain, etc pandoc-lua Issues with our Lua helper functions, filters, etc. in Pandoc
Projects
None yet
Development

No branches or pull requests

3 participants