-
Notifications
You must be signed in to change notification settings - Fork 327
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
perf: Use non-lazy AST traversal for filters when possible #11052
base: main
Are you sure you want to change the base?
Conversation
8a04c2a
to
d7651cc
Compare
f1b9896
to
22ce9b0
Compare
7b844eb
to
4d683c6
Compare
Setting the `QUARTO_JOG_CHECK` environment variable will run checks to identify filters for which the results of `jog` differ from those of pandoc's `walk`.
This should be reversed at some point.
Minor performance improvement.
This allows to get reproducible output when running the filter multiple times.
This check is enabled when the QUARTO_JOG_CHECK environment variable is set.
This reverts commit 1040555.
The filter result might have a different type than the original element, so the type must be retrieved again.
Hi @tarleb, the root cause of the Typst callout failures is that both with jog and without, the following quarto-cli/src/resources/filters/customnodes/callout.lua Lines 46 to 51 in bf93178
will initialize However, when the custom node is read later on to generate Typst,
on jog. quarto-cli/src/resources/filters/customnodes/callout.lua Lines 264 to 272 in bf93178
It's not the right solution, because we'd like to understand why it is converting (?) the title differently, but the following diff gets these tests passing: diff --git a/src/resources/filters/customnodes/callout.lua b/src/resources/filters/customnodes/callout.lua
index 8a9f4c17d..e9deaa2d2 100644
--- a/src/resources/filters/customnodes/callout.lua
+++ b/src/resources/filters/customnodes/callout.lua
@@ -261,10 +261,14 @@ function _callout_main()
end
end
if callout.attr.identifier == "" then
+ local title = callout.title
+ if not title or #title.content == 0 then
+ title = pandoc.Plain(_quarto.modules.callouts.displayName(callout.type))
+ end
return _quarto.format.typst.function_call("callout", {
{ "body", _quarto.format.typst.as_typst_content(callout.content) },
{ "title", _quarto.format.typst.as_typst_content(
- callout.title or pandoc.Plain(_quarto.modules.callouts.displayName(callout.type))
+ title
)},
{ "background_color", pandoc.RawInline("typst", background_color) },
{ "icon_color", pandoc.RawInline("typst", icon_color) }, |
jog
Lua modulejog
resultsWelcome to the quarto GitHub repo!
We are always happy to hear feedback from our users.
To file a pull request, please follow these instructions carefully: https://yihui.org/issue/#bug-reports
If you're a collaborator from outside
quarto-dev
making changes larger than a typo, please make sure you have filed an individual or corporate contributor agreement. You can send the signed copy to [email protected].Also, please complete and keep the checklist below.
Description
Please describe your PR here.
Checklist
I have (if applicable):