1

Is it possible to include additional HTML content or define a common lib_dir, when using the bootstrap_document function as an output type? i.e.

---
output:
  knitrBootstrap::bootstrap_document:
    title: "Test file"
    theme: amelia
    highlight: sunburst
    theme.chooser: TRUE
    highlight.chooser: TRUE
    includes:
      in_header: header.html
      before_body: doc_prefix.html
      after_body: doc_suffix.html
---

I was trying to create a full R Markdown website using bootstrap styled HTML reports.

This is the error that i get

unused argument (includes = list(in_header = "include/in_header.html", before_body = "include/before_body.html", after_body = "include/after_body.html"))
Calls: <Anonymous> -> create_output_format -> do.call -> <Anonymous>
Execution halted
Brani
  • 6,454
  • 15
  • 46
  • 49
  • 1
    I have never tried to do this, but it is something I would like to support. I am currently trying to integrate knitrBootstrap more closely with the rmarkdown package. Also if you tag this with `knitrBootstrap` I will get an email notification about it and would have found it more easily! – Jim Aug 18 '14 at 14:03

1 Answers1

1

It’s possible to create full websites with R Markdown using a combination of the options described above. To create a website you need to:

  1. Create a shared options file (_output.yaml) to ensure common options across all pages within the site.
  2. Specify includes for common header and footer content.
  3. Specify that documents are not self_contained and define a common lib_dir for JavaScript and CSS dependencies.

For example, here’s a possible _output.yaml file for a website:

---
html_document:  
  self_contained: false  
  lib_dir: libs  
  includes:  
    in_header: include/in_header.html  
    before_body: include/before_body.html  
    after_body: include/after_body.html  
---

RMarkdown HTML Documents Reference

Humbert
  • 133
  • 1
  • 9