Hello, I have an RMarkdown file for which I would like to preserve both the html and the .md output. My YAML looks like this: Knitting works fine but there is only html output at the end. Any suggestions on how to get the .md? thank you very much!
title: "blah"
subtitle: "blah blah"
author: "me"
date: '`r Sys.Date()`'
fig_width: 6
fig_height: 4
output:
html_document:
keep_md: true
elben10
February 21, 2018, 5:53pm
2
Try to indent keep_md with a tab. This piece will work:
title: "blah"
subtitle: "blah blah"
author: "me"
date: '`r Sys.Date()`'
fig_width: 6
fig_height: 4
output:
html_document:
keep_md: true
2 Likes
Great -- thank you -- that fixed it. The only issue was the missing indentation.
mara
February 21, 2018, 6:50pm
4
Yeah, YAML is whitespace-sensitive, so you have to be careful with that.
Nice little stash of YAML frontmatter as a gist by Jenny Bryan:
yaml_frontmatter_r_github_document.yaml
#' ---
#' title: "Something fascinating"
#' author: "Jenny Bryan"
#' date: "`r format(Sys.Date())`"
#' output: github_document
#' ---
yaml_frontmatter_r_keep_md.yml
#' ---
#' title: "Something fascinating"
#' author: "Jenny Bryan"
#' date: "`r format(Sys.Date())`"
#' output:
#' html_document:
#' keep_md: TRUE
#' ---
yaml_frontmatter_rmd_github_document.yaml
---
title: "Something fascinating"
author: "Jenny Bryan"
date: "`r format(Sys.Date())`"
output: github_document
---
There are more than three files. show original
2 Likes