pbs-assess / csasdown

:book: An R package for creating CSAS reports in PDF or Word format with R Markdown and bookdown
Other
47 stars 17 forks source link

Can't rename .Rmd files in ResDoc? #251

Closed DylanMG closed 8 months ago

DylanMG commented 8 months ago

I'm looking at a co-worker's old code where they neatly named their .Rmd files 01_introduction, 02_methods, 03_results and so on. I thought this was logical so I renamed the non-descriptive 01-chap1 to 03 -chap3 that populates the directory when you render("resdoc"). I got an error:

Error in `map2()`:
ℹ In index: 2.
Caused by error:
! ✖ Could not copy file from 01-chap1.Rmd to tmp-01-chap1.Rmd
Check that file exists in the current directory

which makes it seem like you have to stick to the 01-chap1 type naming convention? Is that the case or is there a bug somewhere? If it is the case, is there guidance on where intro, methods, results, discussion should go in these 3 pre-defined chapter files?

seananderson commented 8 months ago

Your Rmd's can be called anything you like as long as they match what is in the _bookdown.yml file and your main file is called index.Rmd. Can you provide more details on the setup or ideally replicate this with a new simple template setup (e.g., after a fresh csasdown::draft("resdoc")) and either provide instructions or zip the files up and pass them on?

seananderson commented 8 months ago

It sounds to me from the above that you renamed the files but left the names as 01-chap1.Rmd etc. in the yaml file.

DylanMG commented 8 months ago

Thank you Sean! I didn't know you also had to change it in the bookdown. Would be good to include that as a section in one of the how-to docs. Will add it to my list.