Nick_L
December 3, 2019, 7:48pm
1
Hi all,
Can anyone point me to the source for the pkg_file()
function used in rmarkdown? See e.g. the source code for pandoc_lua_filters()
in pandoc.R within the rmarkdown repo .
pandoc_lua_filters <- function(...) {
args <- c()
# lua filters was introduced in pandoc 2.0
if (pandoc2.0()) {
args <- c(
rbind(
"--lua-filter",
pkg_file("rmd", "lua", ...)
)
)
}
args
}
It doesn't show up when I search the repo, and I haven't been able to locate it in the dependencies. Any help is greatly appreciated!
You can find it in the util.R
file.
pandoc_output_ext <- function(ext, to, input) {
if (!is.null(ext)) return(ext)
if (to %in% c("latex", "beamer")) return(".pdf")
if (to %in% c("html", "html4", "html5", "s5", "slidy", "slideous", "dzslides", "revealjs"))
return(".html")
if (to == "markdown" && tolower(tools::file_ext(input)) != "md") return(".md")
paste0(".", to)
}
pkg_file <- function(...) {
system.file(..., package = "rmarkdown")
}
pkg_file_arg <- function(...) {
pandoc_path_arg(pkg_file(...))
}
#' @rdname rmarkdown_format
#' @export
from_rmarkdown <- function(implicit_figures = TRUE, extensions = NULL) {
2 Likes
Nick_L
December 4, 2019, 4:43pm
3
Thanks! Apparently I'm bad at using Github's search.
1 Like
system
Closed
December 11, 2019, 4:43pm
4
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.