Skip to content

Custom config_file renamed during render #1307

Closed
@debruine

Description

@debruine

I have two different config files for rendering different versions of a book (including or excluding chapters). They have two different names, _bookdown_v1.yml and _bookdown_draft.yml, so I have to set the config_file argument when I render:

bookdown::render_book(config_file = "_bookdown_v1.yml")

During the rendering process, the config file is renamed to _bookdown.yml. This can cause several problems:

  • If that file is open in RStudio, I get a warning that the file has disappeared; rendering pauses until I deal with the modal window
  • If I have another file called _bookdown.yml, it is overwritten, so you can't keep a default file if you ever want to use a custom config file
  • If R crashes or I force-quit during render, _bookdown.yml is not renamed back to _bookdown_v1.yml

There might be a good reason that the file has to be renamed, but I think if you copied it to _bookdown.yml rather than renaming it, it would avoid the first and third problems.

As always, thank you so much for all you do for the R community!

session_info

R version 4.1.0 (2021-05-18)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Mojave 10.14.6, RStudio 1.4.1106

Locale: en_GB.UTF-8 / en_GB.UTF-8 / en_GB.UTF-8 / C / en_GB.UTF-8 / en_GB.UTF-8

Package version:
base64enc_0.1.3 bookdown_0.24 digest_0.6.29 evaluate_0.14 fastmap_1.1.0 glue_1.6.0
graphics_4.1.0 grDevices_4.1.0 highr_0.9 htmltools_0.5.2 jquerylib_0.1.4 jsonlite_1.7.3
knitr_1.37 magrittr_2.0.1 methods_4.1.0 rlang_0.4.12 rmarkdown_2.11 stats_4.1.0
stringi_1.7.6 stringr_1.4.0 tinytex_0.36 tools_4.1.0 utils_4.1.0 xfun_0.29
yaml_2.2.1

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions