diff options
Diffstat (limited to 'test.R')
-rw-r--r-- | test.R | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/test.R b/test.R deleted file mode 100644 index 1a81652d..00000000 --- a/test.R +++ /dev/null @@ -1,45 +0,0 @@ -library(pkgdown) -library(testthat) - -debug(pkgdown:::topic_index) - -build_reference_index(".") - -extract_tag(rd[[1]], "tag_title") # gives "\n" -extract_tag(rd[[4]], "tag_title") # gives the title - -extract_tag(rd[[1]], "tag_alias") # one aliase -extract_tag(rd[[13]], "tag_alias") # two aliases - -library(magrittr) - -extract_tag_1 <- function(x, tag) { - x %>% - purrr::keep(inherits, tag) %>% - unlist %>% - paste(collapse = "") %>% - trimws -} - -extract_tag <- function(x, tag) { - x %>% - purrr::keep(inherits, tag) %>% - purrr::map_chr(c(1, 1)) -} - -extract_tag_1 <- function(x, tag) { - x %>% - purrr::keep(inherits, tag) %>% - purrr::map_chr(function(x) trimws(paste(x, collapse = " "))) -} - -subset(rd[[1]][[1]], - -sapply(extract_tag_1(rd[[1]], "tag_title"), function(x) trimws(paste(x, collapse = " "))) - -extract_tag_1(rd[[1]], "tag_title") -extract_tag_1(rd[[4]], "tag_title") - -extract_tag_1(rd[[1]], "tag_alias") # one aliase -extract_tag_1(rd[[13]], "tag_alias") # two aliases - |