r - readme in staticdocs -
staticdocs hadley wickham bundle can create nifty web pages package. i've used it great success (though haven't figured out how add together examples without error yet) each time have manually reformat readme portion of index.html
file created. seems silly appears ggplot2 staticdocs use there way set readme in index file within of inst/staticdocs/
.
right hadley hasn't documented bundle (staticdocs) , i'm unsure how alter readme argument/list entry in index file. have guidance on format should like; i.e., format of how entry should look?
until hadley , team able develop staticdocs , documentation more here work around found in very rough package:
#' alter read.me file #' #' alter read.me file preset. #' #' @param path path index.html file. #' @param readme path readme file. #' @param file path/file name output. readme_statdoc <- function(path, readme, file = null) { if (length(path) > 1) { x <- path } else { x <- suppresswarnings(readlines(path)) } y <- suppresswarnings(readlines(readme)) start <- which(grepl("<h1></h1>", x)) end <- which(grepl("<h2>help topics</h2>", x)) x <- c(x[1:start], "", y, "", x[end:length(x)]) if (!is.null(file)) { cat(paste(x, collapse="\n"), file = file) } return(x) }
basically create external document insert read me portion. used in qdap , can see how utilize in creating staticdoc web site via this script.
r
No comments:
Post a Comment