From 723470cad6344fcdaa81d16bcf1271fd2480a4c7 Mon Sep 17 00:00:00 2001 From: Mauro Lepore Date: Wed, 27 Nov 2024 16:14:34 +0000 Subject: [PATCH] feat: pkgdown site gains new global search (#42) --- DESCRIPTION | 2 ++ _pkgdown.yml | 3 ++ vignettes/articles/global-search.Rmd | 46 ++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 vignettes/articles/global-search.Rmd diff --git a/DESCRIPTION b/DESCRIPTION index f187f1a..cb377b1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -63,6 +63,8 @@ Remotes: RMI-PACTA/pacta.portfolio.utils Suggests: covr, + DT, + dverse, mockr, testthat (>= 3.0.0) Config/testthat/edition: 3 diff --git a/_pkgdown.yml b/_pkgdown.yml index d0a8abd..b728756 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -9,6 +9,9 @@ navbar: packages: text: "Packages" menu: + - text: "Global search" + href: articles/global-search.html + - text: ----- - text: "pacta.data.scraping" href: https://rmi-pacta.github.io/pacta.data.scraping/ - text: "pacta.portfolio.import" diff --git a/vignettes/articles/global-search.Rmd b/vignettes/articles/global-search.Rmd new file mode 100644 index 0000000..813790f --- /dev/null +++ b/vignettes/articles/global-search.Rmd @@ -0,0 +1,46 @@ +--- +title: "Global search" +--- + +```{r, include = FALSE} +knitr::opts_chunk$set( + echo = FALSE, + collapse = TRUE, + comment = "#>" +) +``` + +```{r setup, message=FALSE} +library(pacta.data.scraping) +library(pacta.data.validation) +library(pacta.executive.summary) +library(pacta.interactive.plot) +library(pacta.portfolio.allocate) +library(pacta.portfolio.audit) +library(pacta.portfolio.import) +library(pacta.portfolio.report) +library(pacta.portfolio.utils) +``` + +```{r} +packages <- c( + "pacta.data.scraping", + "pacta.data.validation", + "pacta.executive.summary", + "pacta.interactive.plot", + "pacta.portfolio.allocate", + "pacta.portfolio.audit", + "pacta.portfolio.import", + "pacta.portfolio.report", + "pacta.portfolio.utils" +) + +url_template <- "https://rmi-pacta.github.io/{package}/reference/{topic}.html" +docs <- dverse::document_universe(packages, url_template) + +exported_helpfiles <- docs %>% + dplyr::filter(type == "help", keyword != "internal" | is.na(keyword)) %>% + dplyr::select(topic, title, package) + +exported_helpfiles %>% DT::datatable(escape = FALSE) +```