-
Notifications
You must be signed in to change notification settings - Fork 10
/
README.Rmd
68 lines (50 loc) · 2.05 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# ymlthis: write YAML for R Markdown, bookdown, blogdown, and more
<!-- badges: start -->
[![R-CMD-check](https://github.com/r-lib/ymlthis/workflows/R-CMD-check/badge.svg)](https://github.com/r-lib/ymlthis/actions)
[![Codecov test coverage](https://codecov.io/gh/r-lib/ymlthis/branch/main/graph/badge.svg)](https://app.codecov.io/gh/r-lib/ymlthis?branch=main)
[![Lifecycle: maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://lifecycle.r-lib.org/articles/stages.html)
[![CRAN status](https://www.r-pkg.org/badges/version/ymlthis)](https://cran.r-project.org/package=ymlthis)
<!-- badges: end -->
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:
``` r
install.packages("ymlthis")
```
Or you can install the development version of ymlthis from GitHub with:
``` r
# install.packages("remotes")
remotes::install_github("r-lib/ymlthis")
```
## Example
`yml()` creates a basic `yml` object returns simple YAML with the author and date.
```{r example}
library(ymlthis)
yml()
```
ymlthis supports many YAML arguments, with YAML-generating functions prefixed with `yml_*()`:
```{r example-2, warning=FALSE}
yml() %>%
yml_author(c("Yihui Xie", "Hadley Wickham"), affiliation = "RStudio") %>%
yml_date(lubridate::today()) %>%
yml_output(
word_document(keep_md = TRUE),
bookdown::html_document2()
) %>%
yml_citations(bibliography = "references.bib", csl = "aje.csl")
```
## 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.
![](https://i.imgur.com/BkzGueG.gif)