所以我想编译 Rmarkdown 文件并将编译后的 html 包含在我博客的博客文章中。具体来说,我正在使用 jquery 加载现有博客文章中已编译的 html 文档。
然而,默认情况下,R markdown 将所有页面内容放在容器 div 中,容器类为 container-fluid 和 main-container。由于我的原始博客文章已经在容器 div 中找到自己,因此结果是文章的已编译 R markdown 部分的双倍间距。
有什么方法可以自动删除已编译的 R markdown 文件中的容器 div?我可以在 Rmarkdown 文件的 header 中包含启用此行为的选项吗?
最佳答案
请参阅 rmarkdown 文档 http://rmarkdown.rstudio.com/html_document_format.html
If want to create an HTML fragment rather than a full HTML document you can use the html_fragment format. For example:
---
output: html_fragment
---
Note that there is no title or author because fragments don’t contain the standard header content that HTML documents do. HTML fragments are typically used for including snippets of HTML within larger web sites (e.g. blogs).
关于javascript - R Markdown : Remove container div when compiling to html,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33959373/