Those discussion are mainly what I am talking about above.
I am still unsure from you answer what is working from the test
dir.create(tmp_dir <- tempfile())
owd <- setwd(tmp_dir)
xfun::write_utf8(c(
"---",
"title: test",
"---",
"",
"# dummy",
""
), "test.md")
convert <- function(template) {
rmarkdown::pandoc_convert(
"test.md",
to = "html",
from = "markdown",
output = "test.html",
verbose = TRUE,
options = c("--template", template)
)
}
# with path computed from R not modified by rmarkdown - should fail ?
convert(system.file("rmd/h/default.html", package = "rmarkdown"))
# with path computed from R but modified by rmarkdown - should work ?
convert(rmarkdown::pandoc_path_arg(system.file("rmd/h/default.html", package = "rmarkdown")))
# manual path - short path with ~
convert("\\coe.ic.gov\\Home\\ESDC\\NGA_HO~2\\al52975\\My Documents\\R\\win-library\\3.6\\rmarkdown\\rmd\\h\\default.html")
convert("//coe.ic.gov/Home/ESDC/NGA_HO~2/al52975/My Documents/R/win-library/3.6/rmarkdown/rmd/h/default.html")
# manual path - long path without ~
convert("\\coe.ic.gov\\Home\\ESDC\\nga_home_052\\al52975\\My Documents\\R\\win-library\\3.6\\rmarkdown\\rmd\\h\\default.html")
convert("//coe.ic.gov/Home/ESDC/nga_home_052/al52975/My Documents/R/win-library/3.6/rmarkdown/rmd/h/default.html")
# manual path - using letter
convert("H:\\My Documents\\R\\win-library\\3.6\\rmarkdown\\rmd\\h\\default.html")
convert("H:/My Documents/R/win-library/3.6/rmarkdown/rmd/h/default.html")
# reseting work dir an cleaning
setwd(owd)
unlink(tmp_dir, recursive = TRUE)
Also, you need to test with last Pandoc so that we understand if Pandoc has fix this or not as it could be the case from Windows UNC Paths Broken · Issue #5127 · jgm/pandoc · GitHub
Basically, this is where I am at:
- It could be a pandoc issue related to Network path. If so, using last Pandoc to convert without using
render() but Pandoc directly or using example code above could confirm or not if this is still the case
- It could be rmarkdown which modifies the file paths in a wrong way on Windows. The above test should tell us.