forked from Lakens/statistical_inferences
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_makefile.R
21 lines (18 loc) · 821 Bytes
/
_makefile.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# render book as html ----
bookdown::render_book("index.Rmd", "bookdown::bs4_book", quiet = TRUE)
browseURL("docs/index.html")
# render book as PDF ----
bookdown::render_book("index.Rmd", "bookdown::pdf_book", quiet = TRUE)
browseURL("docs/statistical_inferences_book.pdf")
# render book as ePub ----
bookdown::render_book("index.Rmd", "bookdown::epub_book", quiet = TRUE)
browseURL("docs/statistical_inferences_book.epub")
# convert to mobi ----
epub <- file.path(getwd(), "docs/statistical_inferences_book.epub")
# requires the command line tools from calibre
ebook_convert <- "/Applications/calibre.app/Contents/MacOS/ebook-convert"
if (file.exists(epub) & file.exists(ebook_convert)) {
mobi <- gsub(".epub$", ".mobi", epub)
if (file.exists(mobi)) file.remove(mobi)
system(paste(ebook_convert, epub, mobi))
}