blogdown中Rmarkdown和Rmd不同扩展名不同作用

Heaven Zone | 2018-04-09  |  R / blogdown

弄blogdown有一段时间,一直有两个疑问:

带着这两个疑问,我翻开了blogdown使用说明书1.5

In this book, we usually mean .Rmd files when we say “R Markdown documents,” which are compiled to .html by default. However, there is another type of R Markdown document with the filename extension .Rmarkdown. Such R Markdown documents are compiled to Markdown documents with the extension .markdown, which will be processed by Hugo instead of Pandoc. There are two major limitations of using .Rmarkdown compared to .Rmd:

  • You cannot use Markdown features only supported by Pandoc, such as citations. Math expressions only work if you have installed the xaringan package (Xie 2018d) and applied the JavaScript solution mentioned in Section B.3.

  • HTML widgets are not supported.

这也解释了为什么安装blogdown会提示安装xaringan「幻灯忍者·写轮眼」

虽然.Rmarkdown.Rmd少了一点点功能(有些地方处理起来可能稍微麻烦一点),不过在绝大部分使用中,生成mardkown文档总是比生成html让人更舒服一点。