bookdown::render_book vs. rmarkdown::render_site to build all outputs
I've got a Bookdown book for which I'd like to build a GitBook site as well as PDF and EPUB downloads. I will use Travis to build all 3 outputs, and the PDF and EPUB will be available for download from the GitBook site.
The bookdown-demo
calls bookdown::render_book
once for each output in _build.sh.
However, according to the logs in RStudio, the Build Book
button, when building All Formats
, uses rmarkdown::render_site(encoding = 'UTF-8')
to build all outputs in a single command.
I'd like to ensure what happens on my CI server is exactly what happens in my IDE, so it seems like I should have Travis call rmarkdown::render_site
rather than several invocations of bookdown::render_book
as is done by the bookdown-demo
. However, Yihui is the expert, and he has chosen to use the latter approach.
So, my question: what is the best script to invoke on a continuous integration server like Travis when multiple outputs will be built?
r r-markdown knitr bookdown
add a comment |
I've got a Bookdown book for which I'd like to build a GitBook site as well as PDF and EPUB downloads. I will use Travis to build all 3 outputs, and the PDF and EPUB will be available for download from the GitBook site.
The bookdown-demo
calls bookdown::render_book
once for each output in _build.sh.
However, according to the logs in RStudio, the Build Book
button, when building All Formats
, uses rmarkdown::render_site(encoding = 'UTF-8')
to build all outputs in a single command.
I'd like to ensure what happens on my CI server is exactly what happens in my IDE, so it seems like I should have Travis call rmarkdown::render_site
rather than several invocations of bookdown::render_book
as is done by the bookdown-demo
. However, Yihui is the expert, and he has chosen to use the latter approach.
So, my question: what is the best script to invoke on a continuous integration server like Travis when multiple outputs will be built?
r r-markdown knitr bookdown
add a comment |
I've got a Bookdown book for which I'd like to build a GitBook site as well as PDF and EPUB downloads. I will use Travis to build all 3 outputs, and the PDF and EPUB will be available for download from the GitBook site.
The bookdown-demo
calls bookdown::render_book
once for each output in _build.sh.
However, according to the logs in RStudio, the Build Book
button, when building All Formats
, uses rmarkdown::render_site(encoding = 'UTF-8')
to build all outputs in a single command.
I'd like to ensure what happens on my CI server is exactly what happens in my IDE, so it seems like I should have Travis call rmarkdown::render_site
rather than several invocations of bookdown::render_book
as is done by the bookdown-demo
. However, Yihui is the expert, and he has chosen to use the latter approach.
So, my question: what is the best script to invoke on a continuous integration server like Travis when multiple outputs will be built?
r r-markdown knitr bookdown
I've got a Bookdown book for which I'd like to build a GitBook site as well as PDF and EPUB downloads. I will use Travis to build all 3 outputs, and the PDF and EPUB will be available for download from the GitBook site.
The bookdown-demo
calls bookdown::render_book
once for each output in _build.sh.
However, according to the logs in RStudio, the Build Book
button, when building All Formats
, uses rmarkdown::render_site(encoding = 'UTF-8')
to build all outputs in a single command.
I'd like to ensure what happens on my CI server is exactly what happens in my IDE, so it seems like I should have Travis call rmarkdown::render_site
rather than several invocations of bookdown::render_book
as is done by the bookdown-demo
. However, Yihui is the expert, and he has chosen to use the latter approach.
So, my question: what is the best script to invoke on a continuous integration server like Travis when multiple outputs will be built?
r r-markdown knitr bookdown
r r-markdown knitr bookdown
edited Nov 14 '18 at 22:03
Jeff Hammerbacher
asked Nov 14 '18 at 21:56
Jeff HammerbacherJeff Hammerbacher
3,38822532
3,38822532
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
In bookdown projects, they usually don't make a difference, because rmarkdown::render_site()
eventually calls bookdown::render_book()
to render your book. Feel free to use either way.
The only exception is when your index.Rmd
does not contain the field site: bookdown::bookdown_site
. In that case, rmarkdown::render_site()
won't work, because it doesn't know this is supposed to be a bookdown project.
BTW, to render all output formats with bookdown::render_book()
, you can use the argument output_format = 'all'
.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53309328%2fbookdownrender-book-vs-rmarkdownrender-site-to-build-all-outputs%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
In bookdown projects, they usually don't make a difference, because rmarkdown::render_site()
eventually calls bookdown::render_book()
to render your book. Feel free to use either way.
The only exception is when your index.Rmd
does not contain the field site: bookdown::bookdown_site
. In that case, rmarkdown::render_site()
won't work, because it doesn't know this is supposed to be a bookdown project.
BTW, to render all output formats with bookdown::render_book()
, you can use the argument output_format = 'all'
.
add a comment |
In bookdown projects, they usually don't make a difference, because rmarkdown::render_site()
eventually calls bookdown::render_book()
to render your book. Feel free to use either way.
The only exception is when your index.Rmd
does not contain the field site: bookdown::bookdown_site
. In that case, rmarkdown::render_site()
won't work, because it doesn't know this is supposed to be a bookdown project.
BTW, to render all output formats with bookdown::render_book()
, you can use the argument output_format = 'all'
.
add a comment |
In bookdown projects, they usually don't make a difference, because rmarkdown::render_site()
eventually calls bookdown::render_book()
to render your book. Feel free to use either way.
The only exception is when your index.Rmd
does not contain the field site: bookdown::bookdown_site
. In that case, rmarkdown::render_site()
won't work, because it doesn't know this is supposed to be a bookdown project.
BTW, to render all output formats with bookdown::render_book()
, you can use the argument output_format = 'all'
.
In bookdown projects, they usually don't make a difference, because rmarkdown::render_site()
eventually calls bookdown::render_book()
to render your book. Feel free to use either way.
The only exception is when your index.Rmd
does not contain the field site: bookdown::bookdown_site
. In that case, rmarkdown::render_site()
won't work, because it doesn't know this is supposed to be a bookdown project.
BTW, to render all output formats with bookdown::render_book()
, you can use the argument output_format = 'all'
.
answered Nov 21 '18 at 20:07
Yihui XieYihui Xie
20.6k11108290
20.6k11108290
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53309328%2fbookdownrender-book-vs-rmarkdownrender-site-to-build-all-outputs%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown