-
Notifications
You must be signed in to change notification settings - Fork 138
Closed
Labels
Description
Describe the bug
I am using rmarkdown within VSCode, and would like to automatically add today's date to the output filename when clicking the 'knit' button. I see that this feature was requested here and added in PR #765, however, I can't get it to work.
To Reproduce
Steps to reproduce the behavior:
- Create file
test.Rmdthat contains the following code:
---
title: "hello world"
knit: (function(input, ...) {
rmarkdown::render(
input,
output_file = paste0(
xfun::sans_ext(input), '-', Sys.Date(), '.html'
),
envir = globalenv()
)
})
---
hello world
Note after clicking the knit button, the following command is automatically called (which I suspect is causing the date to be removed from the filename):
rmarkdown::render("test.Rmd", encoding = "UTF-8")
Environment (please complete the following information):
- OS: macOS but I am using VSCode to connect to a remote server where I am using Rmarkdown/R for analysis
- VSCode Version: 1.69.1
- R Version: 4.1.3
- vscode-R version: v\2.5.2

