Skip to content

Commit

Permalink
add: helper function to create reference index
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomeriko96 committed Jan 5, 2024
1 parent 342b2c7 commit 8b8893c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
^LICENSE\.md$
^build_vvCommander.R
^\.github$
^helperfunctions$
^_pkgdown\.yml$
^docs$
^pkgdown$
Expand Down
20 changes: 20 additions & 0 deletions helperfunctions/data_reference_index_missing.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
library(purrr)
data_reference_index_missing <- function(pkg = ".", depth = 1L) {
pkg <- pkgdown:::as_pkgdown(pkg)

meta <- pkg$meta[["reference"]] %||% pkgdown:::default_reference_index(pkg)
if (length(meta) == 0) {
return(list())
}

# Cross-reference complete list of topics vs. topics found in index page
all_topics <- meta %>%
map(~ pkgdown:::select_topics(.$contents, pkg$topics)) %>%
reduce(union)
in_index <- seq_along(pkg$topics$name) %in% all_topics

missing <- !in_index & !pkg$topics$internal
pkg$topics$name[missing]
}

data_reference_index_missing()

0 comments on commit 8b8893c

Please sign in to comment.