Until Hadley and his team can develop staticdocs and its documentation, here is my work, found in a very rough package :
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 you create an external document to be inserted into the read me part. I used this in qdap and you can see how I use it when creating a staticdoc website through this script .
source
share