You might want to add a catch for pdf_combine() in the instance where there is only one file outputted. (Did not check locally) but I think currently this will output both a {input}.pdf as well as a "slides_combined.pdf" (regardless of length of {input}).
slides_pdf <- function(input){
for (i in 1:length(input)){
pagedown::chrome_print(input = input[i])
}
if(length(input == 1)) return() # new line
pdftools::pdf_combine(input = stringr::str_replace(input, ".html", ".pdf"),
output = "slides_combined.pdf")
}
Let me know if you agree and I can open a PR for this.
You might want to add a catch for pdf_combine() in the instance where there is only one file outputted. (Did not check locally) but I think currently this will output both a {input}.pdf as well as a "slides_combined.pdf" (regardless of length of {input}).
Let me know if you agree and I can open a PR for this.