-
DescriptionI'm exploring using Quarto's environment profiles to generate multiple versions of a document. From the documentation, if we have two environment files, e.g. # multiple profiles on command line
quarto render --profile advanced,production This makes an assumption that one of the profiles specifies an My main question is can I have a quarto extension automatically render the file under multiple profiles if they exist without having the user issue the From there, a couple of side questions are:
We would want to use a new class name such as
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
As you have noticed, this is currently not documented very well, but we're working on improving it. With that said, let me explain to you here how to achieve the outcome of your second question. What we're going to do is we'll write a Lua filter that converts In 1.4, conditional blocks are declared using function Div(div)
if not div.classes:includes(".env-prod") then
return nil
end
local behavior = "content-visible" -- or "content-hidden", as necessary
local condition = {
{"when-profile", "production"},
-- other conditions
}
return quarto.ConditionalBlock({
node = div, -- this is the div containing your content
behavior = behavior,
condition = condition
})
end Your question highlights two quarto shortcomings we hope to address:
|
Beta Was this translation helpful? Give feedback.
As you have noticed, this is currently not documented very well, but we're working on improving it. With that said, let me explain to you here how to achieve the outcome of your second question.
What we're going to do is we'll write a Lua filter that converts
.env-prod
to a conditional block.