Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Global search #42

Merged
merged 7 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
^pkgdown$
^LICENSE\.md$
^codecov\.yml$
^vignettes/articles$
4 changes: 3 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,12 @@ Remotes:
RMI-PACTA/pacta.portfolio.utils
Suggests:
covr,
DT,
dverse,
mockr,
testthat (>= 3.0.0)
Config/testthat/edition: 3
Config/Needs/website: rmi-pacta/pacta.pkgdown.rmitemplate
Config/Needs/website: rmi-pacta/pacta.pkgdown.rmitemplate, rmarkdown
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
5 changes: 4 additions & 1 deletion _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ template:
navbar:
structure:
left: []
right: [intro, packages, methodology, reference, articles, tutorials, news, github, search]
right: [intro, packages, methodology, reference, tutorials, news, github, search]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI intro, tutorials, and news also seem unused.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These were intentionally left in because they're common/default/normal things to have in a pkgdown site, and the goal of this line is to define the structure/order of these items if they exist, so if one of those things is added in the future it will automatically show up in the menu and be placed properly in line with how our other pkgdown sites are structured.

On that note, does this PR mean that we can no longer use articles in the future because of this change? i.e. we have to choose between having this "Global search" function and having the ability to use articles?

components:
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"
Expand Down
2 changes: 2 additions & 0 deletions vignettes/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.html
*.R
46 changes: 46 additions & 0 deletions vignettes/articles/global-search.Rmd
Original file line number Diff line number Diff line change
@@ -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)
```