简体   繁体   English

使用knitrbootstrap的其他HTML内容

[英]Additional HTML content with knitrbootstrap

Is it possible to include additional HTML content or define a common lib_dir , when using the bootstrap_document function as an output type? 使用bootstrap_document函数作为输出类型时,是否可以包含其他HTML内容或定义公共的lib_dir ie

---
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. 我试图使用引导样式的HTML报告创建完整的R Markdown网站

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

It's possible to create full websites with R Markdown using a combination of the options described above. 可以使用上述选项的组合使用R Markdown创建完整的网站。 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. 创建一个共享选项文件(_output.yaml),以确保该站点内所有页面上的公用选项。
  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. 指定文档不是self_contained,并为JavaScript和CSS依赖项定义公共的lib_dir。

For example, here's a possible _output.yaml file for a website: 例如,这是一个网站的_output.yaml文件:

---
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 RMarkdown HTML文档参考

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM