Skip to content

Commit 883affa

Browse files
authored
Prune (#8)
* Simplify Get started * Polish * Prune * Prune * Prune * Spellcheck * Style * Polish * Prune
1 parent 6b4a37c commit 883affa

File tree

8 files changed

+69
-251
lines changed

8 files changed

+69
-251
lines changed

README.Rmd

+11-24
Original file line numberDiff line numberDiff line change
@@ -69,39 +69,26 @@ using [pkgdown](https://pkgdown.r-lib.org/).
6969

7070
## Example
7171

72-
```{r main}
73-
library(dverse)
72+
* `dverse::document_universe()` creates a data frame with the documentation of a
73+
collection of packages.
74+
* `url_template` links each `{topic}` in each `{package}` with its corresponding
75+
documentation online.
7476

77+
```{r}
7578
library(glue)
7679
library(tibble)
77-
universe <- c("glue", "tibble")
7880
79-
# https://glue.tidyverse.org/reference/as_glue.html
80-
# https://tibble.tidyverse.org/reference/as_tibble.html
81+
packages <- c("glue", "tibble")
8182
url_template <- "https://{package}.tidyverse.org/reference/{topic}.html"
83+
docs <- dverse::document_universe(packages, url_template)
8284
83-
docs <- document_universe(universe, url_template)
8485
docs
8586
```
8687

87-
Typically you would hide the code (`echo = FALSE`) and generate click-able links
88-
with `DT::datatable()` or `knitr::kable()`. For example, this code to generates
89-
the table under "All functions in my universe":
88+
* `knitr::kable()` turns the URLs into clickable links.
9089

91-
```{r kable, eval=FALSE}
92-
# Picking only a few rows and columns for a short example
93-
pick <- docs[c("topic", "title", "package")]
94-
knitr::kable(head(pick, 3))
90+
```{r}
91+
knitr::kable(head(docs, 3))
9592
```
9693

97-
### All functions in my universe
98-
99-
This is a basic, universe-wide reference generated with dverse.
100-
101-
```{r echo=FALSE, ref.label="kable"}
102-
103-
```
104-
105-
For customization ideas see `?DT::datatable()`, `?knitr::kable()`, and the
106-
examples in the [dverse
107-
articles](https://maurolepore.github.io/dverse/articles).
94+
* `DT::datatabe()` also provides a search box. See [Get started](https://maurolepore.github.io/dverse/articles/dverse.html).

README.md

+16-25
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,19 @@ website, for example using [pkgdown](https://pkgdown.r-lib.org/).
6565

6666
## Example
6767

68-
``` r
69-
library(dverse)
68+
- `dverse::document_universe()` creates a data frame with the
69+
documentation of a collection of packages.
70+
- `url_template` links each `{topic}` in each `{package}` with its
71+
corresponding documentation online.
7072

73+
``` r
7174
library(glue)
7275
library(tibble)
73-
universe <- c("glue", "tibble")
7476

75-
# https://glue.tidyverse.org/reference/as_glue.html
76-
# https://tibble.tidyverse.org/reference/as_tibble.html
77+
packages <- c("glue", "tibble")
7778
url_template <- "https://{package}.tidyverse.org/reference/{topic}.html"
79+
docs <- dverse::document_universe(packages, url_template)
7880

79-
docs <- document_universe(universe, url_template)
8081
docs
8182
#> # A tibble: 35 × 5
8283
#> topic alias title concept package
@@ -94,27 +95,17 @@ docs
9495
#> # ℹ 25 more rows
9596
```
9697

97-
Typically you would hide the code (`echo = FALSE`) and generate
98-
click-able links with `DT::datatable()` or `knitr::kable()`. For
99-
example, this code to generates the table under “All functions in my
100-
universe”:
98+
- `knitr::kable()` turns the URLs into clickable links.
10199

102100
``` r
103-
# Picking only a few rows and columns for a short example
104-
pick <- docs[c("topic", "title", "package")]
105-
knitr::kable(head(pick, 3))
101+
knitr::kable(head(docs, 3))
106102
```
107103

108-
### All functions in my universe
109-
110-
This is a basic, universe-wide reference generated with dverse.
111-
112-
| topic | title | package |
113-
|:---|:---|:---|
114-
| <a href=https://tibble.tidyverse.org/reference/add_column.html>add_column</a> | Add columns to a data frame | tibble |
115-
| <a href=https://tibble.tidyverse.org/reference/add_row.html>add_row</a> | Add rows to a data frame | tibble |
116-
| <a href=https://glue.tidyverse.org/reference/as_glue.html>as_glue</a> | Coerce object to glue | glue |
104+
| topic | alias | title | concept | package |
105+
|:---|:---|:---|:---|:---|
106+
| <a href=https://tibble.tidyverse.org/reference/add_column.html>add_column</a> | add_column | Add columns to a data frame | addition | tibble |
107+
| <a href=https://tibble.tidyverse.org/reference/add_row.html>add_row</a> | add_row, add_case | Add rows to a data frame | addition | tibble |
108+
| <a href=https://glue.tidyverse.org/reference/as_glue.html>as_glue</a> | as_glue | Coerce object to glue | NA | glue |
117109

118-
For customization ideas see `?DT::datatable()`, `?knitr::kable()`, and
119-
the examples in the [dverse
120-
articles](https://maurolepore.github.io/dverse/articles).
110+
- `DT::datatabe()` also provides a search box. See [Get
111+
started](https://maurolepore.github.io/dverse/articles/dverse.html).

_pkgdown.yml

-16
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,3 @@ template:
55
authors:
66
Mauro Lepore:
77
href: https://github.com/maurolepore
8-
9-
navbar:
10-
components:
11-
reference:
12-
text: "Reference"
13-
href: articles/reference.html
14-
articles:
15-
text: "Articles"
16-
menu:
17-
- text: "Get started"
18-
href: articles/start.html
19-
- text: "Creating a meta-package"
20-
href: articles/meta.html
21-
news:
22-
text: "Changelog"
23-
href: news/index.html

inst/WORDLIST

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
CMD
22
Codecov
3+
Lifecycle
34
ORCID
45
Tidyverse
56
funcitons

vignettes/articles/dverse.Rmd

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
title: "Get started"
3+
---
4+
5+
```{r, include = FALSE}
6+
knitr::opts_chunk$set(
7+
collapse = TRUE,
8+
comment = "#>"
9+
)
10+
```
11+
12+
`dverse::document_universe()` creates a data frame with the documentation of a
13+
collection of R packages. `url_template` links each `topic` in each `package`
14+
with its corresponding documentation online.
15+
16+
```{r}
17+
library(glue)
18+
library(tibble)
19+
20+
packages <- c("glue", "tibble")
21+
url_template <- "https://{package}.tidyverse.org/reference/{topic}.html"
22+
docs <- dverse::document_universe(packages, url_template)
23+
24+
docs
25+
```
26+
27+
Pick rows and columns to organize the documentation however you like (e.g. by
28+
`package` or `concept`).
29+
30+
```{r}
31+
pick <- docs[c("topic", "title", "package")]
32+
```
33+
34+
You may generate a clickable table is with `knitr::kable()`, and also add a search box with `DT::datatable()`.
35+
36+
```{r}
37+
options <- list(dom = "fti", search = list(search = "glue"))
38+
DT::datatable(pick, escape = FALSE, rownames = NULL, options = options)
39+
```
40+
41+
See `?DT::datatable()` for more options.

vignettes/articles/meta.Rmd

-65
This file was deleted.

vignettes/articles/reference.Rmd

-34
This file was deleted.

vignettes/articles/start.Rmd

-87
This file was deleted.

0 commit comments

Comments
 (0)