Submitting package documentation to github wiki

Question:
Are there any tricks that will display package documentation Rd

in wiki giki pages? Supported markups github wiki: https://github.com/github/markup#markups

Background:
There are tons of CRAN packages on the html mirrors. This kind of web template for R documentation can be extended for packages hosted on github. If it Rd

were possible in a wiki, it would be very easy. Many, perhaps even most of the hosted github packages don't use the wiki at all.

+3


source to share


1 answer


There are several design functions tools

for working with Rd

files.

One option is to convert it to html and then markdown with pandoc :



#' Convert rd file to markdown
#' @param rd path to rd file
rd_to_markdown <- function(rd) {
    html <-  paste(rd, ".html", sep = "")
    tools::Rd2HTML(tools::parse_Rd(rd), out = html)
    system( paste("pandoc -s -r html ", html, " -o ", rd, ".text", sep=""))
    unlink(html)
}

      

The result is quite long, but it could be worse.

+2


source







All Articles