簡體   English   中英

使用knitrbootstrap的其他HTML內容

[英]Additional HTML content with knitrbootstrap

使用bootstrap_document函數作為輸出類型時,是否可以包含其他HTML內容或定義公共的lib_dir

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

我試圖使用引導樣式的HTML報告創建完整的R Markdown網站

這是我得到的錯誤

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

可以使用上述選項的組合使用R Markdown創建完整的網站。 要創建網站,您需要:

  1. 創建一個共享選項文件(_output.yaml),以確保該站點內所有頁面上的公用選項。
  2. 為公共頁眉和頁腳內容指定包含。
  3. 指定文檔不是self_contained,並為JavaScript和CSS依賴項定義公共的lib_dir。

例如,這是一個網站的_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文檔參考

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM