aboutsummaryrefslogtreecommitdiff
path: root/test.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2016-11-04 15:38:09 +0100
committerJohannes Ranke <jranke@uni-bremen.de>2016-11-04 15:38:09 +0100
commit09f4f904af23a34d68d5d78482a5b9e12d9a9494 (patch)
tree60b61d802985e6a4328c57e32099e66217403026 /test.R
parentdb73a6bab3a60de98d020442e4ad103f47df9ab0 (diff)
Static documentation rebuilt by pkgdown::build_site()
With updated pkgdown with my PR
Diffstat (limited to 'test.R')
-rw-r--r--test.R38
1 files changed, 25 insertions, 13 deletions
diff --git a/test.R b/test.R
index 264c2239..1a81652d 100644
--- a/test.R
+++ b/test.R
@@ -1,33 +1,45 @@
library(pkgdown)
+library(testthat)
-debug(pkgdown:::as_pkgdown)
debug(pkgdown:::topic_index)
-debug(pkgdown:::package_rd) # creates rd object (list of Rd file representations)
-
-
-undebug(pkgdown:::rd_file) # creates rd file representations
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)
-library(stringr)
-extract_tag_local <- function(x, tag) {
+
+extract_tag_1 <- function(x, tag) {
x %>%
purrr::keep(inherits, tag) %>%
unlist %>%
paste(collapse = "") %>%
- str_trim
+ 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 = " ")))
}
-extract_tag_local(rd[[1]], "tag_title")
-extract_tag_local(rd[[4]], "tag_title")
+subset(rd[[1]][[1]],
+sapply(extract_tag_1(rd[[1]], "tag_title"), function(x) trimws(paste(x, collapse = " ")))
-titles <- purrr::map_chr(rd, extract_tag, "tag_title")
+extract_tag_1(rd[[1]], "tag_title")
+extract_tag_1(rd[[4]], "tag_title")
-titles <- purrr::map_chr(rd, extract_tag_local, "tag_title")
+extract_tag_1(rd[[1]], "tag_alias") # one aliase
+extract_tag_1(rd[[13]], "tag_alias") # two aliases
-rd[[2]]

Contact - Imprint