-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
96 lines (73 loc) · 3.43 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
---
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%"
)
```
# dverse
<!-- badges: start -->
[![R-CMD-check](https://github.com/maurolepore/dverse/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/maurolepore/dverse/actions/workflows/R-CMD-check.yaml)
[![Codecov test coverage](https://codecov.io/gh/maurolepore/dverse/graph/badge.svg)](https://app.codecov.io/gh/maurolepore/dverse)
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[![CRAN status](https://www.r-pkg.org/badges/version/dverse)](https://CRAN.R-project.org/package=dverse)
<!-- badges: end -->
The goal of dverse is to document a universe. It creates a data frame containing
the metadata associated with the documentation of a collection of R packages. It
allows for linking topic names to their corresponding documentation online.
If you have a meta-package, dverse helps you to create a comprehensive reference
for its website.
## Installation
Install from CRAN:
``` r
install.packages("dverse")
```
or get a development version from GitHub:
``` r
# install.packages("pak")
pak::pak("maurolepore/dverse")
```
## Motivation
The [Tidyverse](https://www.tidyverse.org/) popularized the idea of a "universe
of packages." The typical universe has a meta-package that centralizes access to
functions and data across all its packages. For example, with `library(tidyverse)` the [tidyverse
meta-package](https://tidyverse.tidyverse.org/) centralizes access to the
functions in [dplyr](https://dplyr.tidyverse.org/),
[ggplot2](https://ggplot2.tidyverse.org/), and several other packages in the
[Tidyverse universe](https://www.tidyverse.org/).
However, meta-packages typically don't centralize documentation. For example,
the tidyverse website only shows the [documentation for the tidyverse meta-package
itself](https://tidyverse.tidyverse.org/reference/index.html) but does not show
the [documentation for dplyr](https://dplyr.tidyverse.org/reference/index.html),
[ggplot2](https://ggplot2.tidyverse.org/reference/index.html), and other packages
in the Tidyverse.
The [dverse](https://maurolepore.github.io/dverse/) package solves this problem.
It creates a data frame containing the metadata associated with the
documentation of any set of packages. This data frame can be easily used to
generate the universe-wide reference for the meta-package website, for example
using [pkgdown](https://pkgdown.r-lib.org/).
## Example
* `document_universe()` creates a data frame with documentation metadata of one or
more packages.
* `url_template` can take different templates for the manual and vignettes.
* `knitr::kable()` turns the URLs into clickable links. `DT::datatabe()` also
provides a search box.
```{r}
library(dverse)
library(glue)
library(tibble)
universe <- c("glue", "tibble")
document_universe(universe)
# Assuming vignettes can be found at */articles/* rather than */reference/*
manual <- "https://{package}.tidyverse.org/reference/{topic}.html"
document_universe(universe, url_template = manual)
# Adding an explicit template for vignettes
vignettes <- "https://{package}.tidyverse.org/articles/{topic}.html"
docs <- document_universe(universe, url_template = c(manual, vignettes))
knitr::kable(tail(docs))
```