Shiny 中实时渲染 markdown 和 RMarkdown:
<br />
# render .md files to html on-the-fly<br />
includeMD = function(file) {<br />
return(markdownToHTML(file, options = c(''), stylesheet = 'www/empty.css'))<br />
}</p>
<p># render .Rmd files to html on-the-fly<br />
includeRmd = function(path) {<br />
# shiny:::dependsOnFile(path)<br />
contents = paste(readLines(path, warn = FALSE), collapse = '\n')<br />
# do not embed image or add css<br />
html = knit2html(text = contents, fragment.only = TRUE,<br />
quiet = TRUE, options = '', stylesheet = 'www/empty.css')<br />
Encoding(html) = 'UTF-8'<br />
HTML(html)<br />
}<br />
</p>