create single, standalone html bookdown file w/gitbook format & style
Asked Answered
B

1

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: ...

Biebel answered 18/11, 2018 at 17:29 Comment(0)
M
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.

Milurd answered 19/11, 2018 at 10:33 Comment(2)
Is css required?Otten
@JeffBezos No, I took that from the OP.Milurd

© 2022 - 2024 — McMap. All rights reserved.