6

How do I create a single, standalone bookdown html file that retains the gitbook format/style? Using the bookdown demo, my goal is to create a single .html file that I can share or publish to my website. I want to retain the gitbook style (table of contents, layout, color, etc) but I don't want the format as gitbook or epub; I want the format as a single .html file.

This post is related but does not answer my question. When I add 'split_by:none' to my _output.yml file it does create a single html file. But that .html file is still not a standalone document; if I copy and paste it elsewhere it does not retain the layout, style, and functionality. How can I achieve a single, standalone html file with the gitbook format/style using bookdown?

bookdown::gitbook: split_by: none css: ...

1 Answer 1

7

You can produce a self contained file using

bookdown::gitbook:
  split_by: none
  self_contained: true
  css: ...

However, while this does work in principle, you might get into trouble along the way, c.f. https://github.com/rstudio/bookdown/issues/61#issuecomment-200996786.

Sign up to request clarification or add additional context in comments.

2 Comments

Is css required?
@JeffBezos No, I took that from the OP.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.