Skip to content

Commit

Permalink
fix #834: preserve input Rmd's origin path in opts (#955)
Browse files Browse the repository at this point in the history
Remove input Rmd file's path in opts could bring inconsistency.
For example in `split_chapter()`, we compare `input_rmd` and `nms_chaps`
to determine if we could skip writing html. Then when we call
`serve_book()`, all the changed Rmd files under subdir will be ignored
due to the absence of `input_rmd`'s full path.
This is the root cause of #834.
  • Loading branch information
shenfei committed Oct 13, 2020
1 parent a0211f8 commit 7ace59f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

- The new syntax for theorem and proof environments introduced in **bookdown** requires Pandoc >= 2.3 instead of 2.0 (thanks, @markhymers, #979 #980).

## MINOR CHANGES

- `opts$get('input_rmd')` now stores original file path rather than basename, and when Rmd file under subdirectory changes, `serve_book()` will refresh correctly now (thanks, @shenfei, #834 #955).

# CHANGES IN bookdown VERSION 0.21

## NEW FEATURES
Expand Down
2 changes: 1 addition & 1 deletion R/render.R
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ render_book = function(
if (!preview) unlink(ref_keys_path(output_dir)) # clean up reference-keys.txt
# store output directory and the initial input Rmd name
opts$set(
output_dir = output_dir, input_rmd = basename(input), preview = preview
output_dir = output_dir, input_rmd = input, preview = preview
)

aux_diro = '_bookdown_files'
Expand Down

0 comments on commit 7ace59f

Please sign in to comment.