javascript - R Markdown : Remove container div when compiling to html

标签 javascript html css r r-markdown

所以我想编译 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/

相关文章:

javascript - 如何水平增加此div的背景

javascript - 如何在 Angular js中增加数字字符串值

javascript - Canvas 访问平移背景图像的平移位置坐标

css - 模块 CSS 未加载到元素中

html - 控制单选按钮对齐

javascript - setTimeout 作为 react setState 的回调?

javascript - 在 jQuery 中创建一致的 URL

jquery - 摆脱 Bootstrap 小 View 中的第二行等

javascript - 保持元素在父元素的底部

在 jQuery 之后加载 CSS