diff options
author | Johannes Ranke <jranke@uni-bremen.de> | 2016-11-03 14:33:05 +0100 |
---|---|---|
committer | Johannes Ranke <jranke@uni-bremen.de> | 2016-11-03 17:48:31 +0100 |
commit | f39815aa87272849f8e0c808099c4cee780c2a81 (patch) | |
tree | d3f59ae226591252e17737e12bae7f90be278b7b /test.R | |
parent | bad0c7caff62aa90225ae8acee43b297bdc28b25 (diff) |
Static documentation rebuilt by pkgdown::build_site()
Using pkgdown with PR hadley/pkgdown#212
Diffstat (limited to 'test.R')
-rw-r--r-- | test.R | 33 |
1 files changed, 33 insertions, 0 deletions
@@ -0,0 +1,33 @@ +library(pkgdown) + +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 + +library(magrittr) +library(stringr) +extract_tag_local <- function(x, tag) { + x %>% + purrr::keep(inherits, tag) %>% + unlist %>% + paste(collapse = "") %>% + str_trim +} + +extract_tag_local(rd[[1]], "tag_title") +extract_tag_local(rd[[4]], "tag_title") + + +titles <- purrr::map_chr(rd, extract_tag, "tag_title") + +titles <- purrr::map_chr(rd, extract_tag_local, "tag_title") + +rd[[2]] |