-
-
Notifications
You must be signed in to change notification settings - Fork 996
Description
We are currently adding some lua filter also in rstudio/bookdown#940
There are several pieces missing to make things easier to extend what is done in rmarkdown
-
pandoc_lua_filtershelper is currently only working for rmarkdown filter. We currently create the same helper for each 📦 -
The lua filters are not including the same way in all 📦 so it is not easy to make another package filter run before or after another one.
About 2, sometime it is add inside the pre_processor part of the function
rmarkdown/R/html_document_base.R
Lines 109 to 110 in 284b685
| # a lua filters added if pandoc2.0 | |
| args <- c(args, pandoc_lua_filters(c("pagebreak.lua", "latex-div.lua"))) |
and in others outside of the pre preprocessor in the main format function, before pandoc_args argument
Lines 145 to 149 in 284b685
| # lua filters (added if pandoc > 2) | |
| args <- c(args, pandoc_lua_filters(c("pagebreak.lua", "latex-div.lua"))) | |
| # args args | |
| args <- c(args, pandoc_args) |
We could start fixing this by being more aligned in all format.
And to improve, I think we need a mechanism for choosing the order of the filter (pandoc will run in the order of the command line). This is necessary to avoir conflicts. There are several ways to that IMO - one is to make lua filters activate with a switch.