Skip to content

Commit

Permalink
Style
Browse files Browse the repository at this point in the history
  • Loading branch information
maurolepore committed Jan 6, 2019
1 parent c40784d commit e5cc686
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 47 deletions.
95 changes: 59 additions & 36 deletions docs/articles/siteonly/reference-tidyverse.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/articles/siteonly/reference.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 20 additions & 7 deletions vignettes/siteonly/reference-tidyverse.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,38 @@ library(pkgdoc)
library(tidyverse)
library(glue)
library(DT)
```

Let's pull the documenation of all core-tidyverse-packages with __pkgdoc__.

(docs <- reference_package(tidyverse:::core) %>% arrange(package))
```{r}
(docs <- reference_package(tidyverse:::core))
```

`reference_package()` and `reference_concept()` include the argument `url` but it only works if all packages are under the GitHub organization and the url is formatted as `https://{organization}.github.io/{package}/`. But we can create arbitrary links easily with `glue::glue()`.

```{r}
linked <- mutate(
docs,
topic = glue("<a href=https://{package}.tidyverse.org/reference/{topic}>?</a>"),
package = glue("<a href=https://{package}.tidyverse.org/index.html>{package}</a>")
link_topic <- function(package, topic) {
glue("<a href=https://{package}.tidyverse.org/reference/{topic}>{topic}</a>")
}
link_package <- function(package) {
glue("<a href=https://{package}.tidyverse.org/index.html>{package}</a>")
}
linked <- docs %>%
mutate(
topic = link_topic(package, topic),
package = link_package(package)
)
linked
```

We are almost ready. Let's arrange the documentation by package and use `DT::datatable()` to create clickable links.
We are now read to create a searchable table with `DT::datatable()`.

```{r}
linked %>%
arrange(.data$package) %>%
datatable(
escape = FALSE,
rownames = NULL,
Expand Down

0 comments on commit e5cc686

Please sign in to comment.