diff --git a/DESCRIPTION b/DESCRIPTION index 2a470a575..108e72c0d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: bookdown Type: Package Title: Authoring Books and Technical Documents with R Markdown -Version: 0.9.15 +Version: 0.9.16 Authors@R: c( person("Yihui", "Xie", role = c("aut", "cre"), email = "xie@yihui.name", comment = c(ORCID = "0000-0003-0645-5666")), person("JJ", "Allaire", role = "ctb"), diff --git a/NEWS.md b/NEWS.md index dadd75ddf..1d17ebd5c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -22,6 +22,8 @@ - Hyphenated words will be correctly highlighted in the search results now if spaces are used in the search keyword instead of dashes, e.g., you can search for `hand-off` using the keyword `hand off` (thanks, @aronatkins, #701). +- When `rmd_files` is configured in `_bookdown.yml`, `render_book()` will fail if the output format is not HTML or LaTeX (thanks, Ladislas Nalborczyk, https://stackoverflow.com/q/56061122/559676). + ## MINOR CHANGES - Added alt/hover text to icons on the `gitbook` toolbar (thanks, @aronatkins, #698). diff --git a/R/utils.R b/R/utils.R index a04cfb40c..5efaa03db 100644 --- a/R/utils.R +++ b/R/utils.R @@ -64,10 +64,8 @@ source_files = function(format = NULL, config = load_config(), all = FALSE) { if (is.character(subdir)) subdir else '.', '[.]Rmd$', ignore.case = TRUE, recursive = subdir_yes, full.names = subdir_yes )) - if (length(files2 <- config[['rmd_files']]) > 0) { - if (is.list(files2)) { - files2 = if (all && is.null(format)) unlist(files2) else files2[[format]] - } + if (length(files2 <- config[['rmd_files']]) > 0 && !is.null(format)) { + if (is.list(files2)) files2 = if (all) unlist(files2) else files2[[format]] files = if (subdir_yes) c(files2, files) else files2 } else { files = files[grep('^[^_]', basename(files))] # exclude those start with _