Skip to content
Discussion options

You must be logged in to vote

Good question !

One way to do it is that if your filter is ran within Quarto context, the Quarto Lua API will be defined
https://prerelease.quarto.org/docs/extensions/lua-api.html#quarto-lua-api

So you could test for quarto object, or quarto.version for example. If it exists, then you are in Quarto context.

Example

if quarto and quarto.version then
  quarto.log.output("Running in Quarto: " .. tostring(quarto.version))
else
  print("Not running in Quarto")
end

return {}

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@pagiraud
Comment options

Answer selected by pagiraud
Comment options

You must be logged in to vote
1 reply
@cderv
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lua Issues related to the lua codebase, filter chain, etc
2 participants