-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add: helper function to create reference index
- Loading branch information
1 parent
342b2c7
commit 8b8893c
Showing
2 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
^LICENSE\.md$ | ||
^build_vvCommander.R | ||
^\.github$ | ||
^helperfunctions$ | ||
^_pkgdown\.yml$ | ||
^docs$ | ||
^pkgdown$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |