Skip to content
write YAML for R Markdown, bookdown, blogdown, and more
R
Branch: master
Clone or download
malcolmbarrett Merge pull request #42 from r-lib/remove_blank_line
Add option to remove final blank line
Latest commit f7631f4 Oct 18, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github add contrib and coc docs Jul 13, 2019
R
inst turn scrolling on in addin, add height Sep 23, 2019
man-roxygen clean up first section of documentation Jul 17, 2019
man Merge pull request #42 from r-lib/remove_blank_line Oct 18, 2019
tests address cran feedback re: options, dontrun Aug 26, 2019
vignettes address cran feedback re: options, dontrun Aug 26, 2019
.Rbuildignore ignore test rmd Sep 23, 2019
.gitignore ignore test rmd Sep 23, 2019
.travis.yml try moving package installs to remotes Aug 20, 2019
DESCRIPTION Increment version number Oct 2, 2019
LICENSE add basic structure and functions Jun 8, 2019
LICENSE.md add basic structure and functions Jun 8, 2019
NAMESPACE Add addin Aug 7, 2019
NEWS.md add news item Oct 11, 2019
README.Rmd clean up addin gif Oct 10, 2019
README.md clean up addin gif Oct 10, 2019
_pkgdown.yml fix news header on pkgdown site Oct 11, 2019
appveyor.yml update appveyor Jul 13, 2019
codecov.yml add appveyor and covr Jul 13, 2019
ymlthis.Rproj use_*_yml() fns, update docs, fix bugs Jun 14, 2019

README.md

ymlthis: write YAML for R Markdown, bookdown, blogdown, and more

Build Status AppVeyor build status Codecov test coverage Lifecycle: maturing CRAN status

ymlthis makes it easy to write YAML front matter for R Markdown and related documents. yml_*() functions write functions and use_*() functions let you write the resulting YAML to your clipboard or to .yml files related to your project.

Installation

You can install ymlthis from CRAN with:

install.packages("ymlthis")

Or you can install the development version of ymlthis from GitHub with:

# install.packages("remotes")
remotes::install_github("r-lib/ymlthis")

Example

yml() creates a basic yml object returns simple YAML with the author and date.

library(ymlthis)

yml()
#> ---
#> author: Malcolm Barrett
#> date: '`r format(Sys.Date())`'
#> ---

ymlthis supports many YAML arguments, with YAML-generating functions prefixed with yml_*():

yml() %>% 
  yml_author(c("Yihui Xie", "Hadley Wickham"), affiliation = "RStudio") %>% 
  yml_date(lubridate::today()) %>% 
  yml_output(
    pdf_document(keep_tex = TRUE, includes = includes2(after_body = "footer.tex")), 
    bookdown::html_document2()
  ) %>% 
  yml_latex_opts(biblio_style = "apalike")
#> ---
#> author:
#> - name: Yihui Xie
#>   affiliation: RStudio
#> - name: Hadley Wickham
#>   affiliation: RStudio
#> date: '2019-10-10'
#> output:
#>   pdf_document:
#>     keep_tex: true
#>     includes:
#>       after_body: footer.tex
#>   bookdown::html_document2: default
#> biblio-style: apalike
#> ---

Add-in

ymlthis also includes an add-in that will create YAML for you and put it in a file, such as an .Rmd file, or on your clipboard.

You can’t perform that action at this time.