Reputation: 503
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: ...
Upvotes: 6
Views: 1873
Reputation: 26843
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.
Upvotes: 7