Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/r-lib/ymlthis
write YAML for R Markdown, bookdown, blogdown, and more
https://github.com/r-lib/ymlthis
Last synced: 4 days ago
JSON representation
write YAML for R Markdown, bookdown, blogdown, and more
- Host: GitHub
- URL: https://github.com/r-lib/ymlthis
- Owner: r-lib
- License: other
- Created: 2019-06-03T20:45:14.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2022-08-05T16:02:23.000Z (over 2 years ago)
- Last Synced: 2024-10-13T08:50:17.720Z (about 1 month ago)
- Language: R
- Homepage: https://ymlthis.r-lib.org/
- Size: 5.11 MB
- Stars: 164
- Watchers: 9
- Forks: 10
- Open Issues: 16
-
Metadata Files:
- Readme: README.Rmd
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
- jimsghstars - r-lib/ymlthis - write YAML for R Markdown, bookdown, blogdown, and more (R)
README
---
output: github_document
---
```{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[![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)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)