forked from carpentries/glosario-r
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
69 lines (47 loc) · 1.9 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
69
---
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%"
)
```
# glosario
<!-- badges: start -->
[![R build status](https://github.com/carpentries/glosario-r/workflows/R-CMD-check/badge.svg)](https://github.com/carpentries/glosario-r/actions)
[![codecov](https://codecov.io/gh/carpentries/glosario-r/branch/master/graph/badge.svg)](https://codecov.io/gh/carpentries/glosario-r)
<!-- badges: end -->
`glosario` allows users to create and retrieve multilingual glossaries. By
default, `glosario` provides access to a [community-curated glossary](https://glosario.carpentries.org) hosted by The Carpentries. This repository also documents the structure expected for the glossaries that can be managed by `glosario`.
There is also a [Python interface](https://glosario.readthedocs.io/en/latest/).
## Installation
`glosario` is still in the development stage and is only available from [GitHub](https://github.com/) with:
``` r
# install.packages("remotes")
remotes::install_github("carpentries/glosario-r")
```
## Example
```{r example}
library(glosario)
define("data frame")
```
To get definitions in other languages we would do:
```{r french}
define("plus_one", lang = 'fr')
```
If you want to use your custom glossary file you can do it the following way:
```{r}
custom_url <- "https://raw.githubusercontent.com/carpentries/glosario/master/glossary.yml"
g <- get_glossary(url = custom_url)
define("plus_one", lang = 'fr', glossary = g)
```
To add links to definitions, you can use the `gdef` function for inline writing:
```{r, eval=FALSE}
This is a `r gdef('data_frame', 'Data Frame')`, they are used for storing data.
```
Which would look like this:
> This is a `r gdef('data_frame', 'Data Frame')`, they are used for storing data.