Sitelet https://github.com/r-lib/yaml/commit/8c805c59b9501773b51369caaa5ad209edd713d8
Skip to content

Commit 8c805c5

Browse files
authored
✨Extract out getting started vignette ✨ (#156)
And drop old development system.
1 parent e4d349b commit 8c805c5

10 files changed

Lines changed: 404 additions & 649 deletions

File tree

‎.Rbuildignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@
1313
^_pkgdown\.yml$
1414
^docs$
1515
^pkgdown$
16+
^README\.Rmd$

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ yaml_*.tar.gz
88
.Rproj.user
99
*.Rproj
1010
docs
11+
inst/doc

‎DESCRIPTION‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,15 @@ Authors@R: c(
2525
Description: Implements the 'libyaml' 'YAML' 1.1 parser and emitter
2626
(<https://pyyaml.org/wiki/LibYAML>) for R.
2727
License: BSD_3_clause + file LICENSE
28-
URL: https://r-yaml.r-lib.org, https://github.com/r-lib/r-yaml/
28+
URL: https://yaml.r-lib.org, https://github.com/r-lib/r-yaml/
2929
BugReports: https://github.com/lib/r-yaml/issues
3030
Suggests:
31+
knitr,
32+
rmarkdown,
3133
testthat (>= 3.0.0)
3234
Config/testthat/edition: 3
3335
Config/Needs/website: tidyverse/tidytemplate
3436
Encoding: UTF-8
3537
Roxygen: list(markdown = TRUE)
3638
RoxygenNote: 7.3.3
39+
VignetteBuilder: knitr

‎Makefile‎

Lines changed: 0 additions & 159 deletions
This file was deleted.

‎README.Rmd‎

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
output: github_document
3+
---
4+
5+
<!-- README.md is generated from README.Rmd. Please edit that file -->
6+
7+
```{r, include = FALSE}
8+
knitr::opts_chunk$set(
9+
collapse = TRUE,
10+
comment = "#>",
11+
fig.path = "man/figures/README-",
12+
out.width = "100%"
13+
)
14+
```
15+
16+
# yaml
17+
18+
<!-- badges: start -->
19+
[![R-CMD-check](https://github.com/r-lib/r-yaml/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/r-lib/r-yaml/actions/workflows/R-CMD-check.yaml)
20+
[![Codecov test coverage](https://codecov.io/gh/r-lib/r-yaml/graph/badge.svg)](https://app.codecov.io/gh/r-lib/r-yaml)
21+
<!-- badges: end -->
22+
23+
yaml provides R bindings to [libyaml](https://pyyaml.org/wiki/LibYAML), a fast [YAML](http://yaml.org) parser and emitter.
24+
25+
## Installation
26+
27+
Install from CRAN:
28+
29+
```{r}
30+
#| eval: false
31+
install.packages("yaml")
32+
```
33+
34+
Or install the development version from GitHub:
35+
36+
```{r}
37+
#| eval: false
38+
# install.packages("pak")
39+
pak::pak("r-lib/r-yaml")
40+
```
41+
42+
## Usage
43+
44+
```{r}
45+
library(yaml)
46+
```
47+
48+
Parse YAML with `yaml.load()` or `read_yaml()`:
49+
50+
```{r}
51+
yaml.load(
52+
"
53+
- 1
54+
- 2
55+
- 3
56+
"
57+
)
58+
59+
yaml.load(
60+
"
61+
a: 1
62+
b: 2
63+
"
64+
)
65+
```
66+
67+
Convert R objects to YAML with `as.yaml()` or `write_yaml()`:
68+
69+
```{r}
70+
cat(as.yaml(list(a = 1:3, b = 4:6)))
71+
```
72+
73+
See `vignette("yaml")` for more details on handlers, formatting options, and advanced usage.

0 commit comments

Comments
 (0)