Skip to content

Commit

Permalink
Add support for litedown
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Nov 18, 2024
1 parent ed5b236 commit ac6236f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions R/articles.R
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,17 @@ replace_rmarkdown_engine <- function(){
quarto_engine <- tools::vignetteEngine('html', package='quarto')
environment(quarto_engine$weave)$meta$format$html <- quarto_html_meta()
})

# Use knitr for of litedown (not sure if they use compatible Rmarkdown?)
setHook(packageEvent("litedown", "onLoad"), function(...) {
message("Found litedown! Replacing html engine...")
tools::vignetteEngine('vignette', package = 'litedown', tangle = rmd_engine$tangle,
pattern = rmd_engine$pattern, weave = function(file,..., output_format = NULL){
load_custom_output_package(file)
rmd_engine$weave(file,..., output_format = r_universe_format())
}
)
})
}

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

0 comments on commit ac6236f

Please sign in to comment.