Skip to content

Commit

Permalink
For pandoc 3.0+, use --split-level instead of deprecated `--epub-ch…
Browse files Browse the repository at this point in the history
…apter-level`
  • Loading branch information
cderv committed May 4, 2023
1 parent e8dfa70 commit feca9bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

- Fix an issue with CSL using hanging indent style in `gitbook()` (thanks, @pablobernabeu, #1422).

- Adapt `epub_book()` internal command line argument passed to Pandoc for changes from version 3.0 and above.

# CHANGES IN bookdown VERSION 0.33

- `extra_dependencies` in `gitbook()` is now correctly working (thanks, @ThierryO, #1408).
Expand Down
4 changes: 3 additions & 1 deletion R/ebook.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ epub_book = function(
if (!is.null(cover_image)) c('--epub-cover-image', cover_image),
if (!is.null(metadata)) c('--epub-metadata', metadata),
if (!identical(template, 'default')) c('--template', template),
if (!missing(chapter_level)) c('--epub-chapter-level', chapter_level)
if (!missing(chapter_level))
c(if (rmarkdown::pandoc_available("3.0")) '--split-level' else '--epub-chapter-level', chapter_level)
)
if (is.null(stylesheet)) css = NULL else {
css = rmarkdown::pandoc_path_arg(epub_css(stylesheet))
Expand Down Expand Up @@ -253,3 +254,4 @@ calibre = function(input, output, options = '') {
if (!file.exists(output)) stop('Failed to convert ', input, ' to ', output)
invisible(output)
}

0 comments on commit feca9bc

Please sign in to comment.