Skip to content

Commit ac6236f

Browse files
committed
Add support for litedown
1 parent ed5b236 commit ac6236f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

R/articles.R

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,17 @@ replace_rmarkdown_engine <- function(){
110110
quarto_engine <- tools::vignetteEngine('html', package='quarto')
111111
environment(quarto_engine$weave)$meta$format$html <- quarto_html_meta()
112112
})
113+
114+
# Use knitr for of litedown (not sure if they use compatible Rmarkdown?)
115+
setHook(packageEvent("litedown", "onLoad"), function(...) {
116+
message("Found litedown! Replacing html engine...")
117+
tools::vignetteEngine('vignette', package = 'litedown', tangle = rmd_engine$tangle,
118+
pattern = rmd_engine$pattern, weave = function(file,..., output_format = NULL){
119+
load_custom_output_package(file)
120+
rmd_engine$weave(file,..., output_format = r_universe_format())
121+
}
122+
)
123+
})
113124
}
114125

115126
# If a package uses a custom 'output' it may also assume functions from this package

0 commit comments

Comments
 (0)