Is there some mechanism with which I can convert the comments that roxygen sees, preferably before it converts roxygen-> rd?
For example, suppose I have:
#' My function. Does stuff with numbers. #'
Now suppose I want to do some conversion of the comment before roxygen analyzes it, for example, replacing all instances of things in backticks with \code{} . I.e:
preprocess <- function (txt) { gsub('`([^ ]+)`', '\\\\code{\\1}', txt) }
Is there any way to pass preprocess to roxygen so that it runs it on docs earlier (or after that would work in this case) does roxygen do its document creation?
I do not want to do a constant find-replace in my .r files. As you can guess from my example, I am aiming for some rudimentary markup support in my roxygen comments and, therefore, want to save the .r files as-to in order to maintain readability (and programmatically insert \code{..} ).
Should I just write my own version of roxygenise , which launches a preprocess for all detected roxygen-style comments in my files, temporarily saves them somewhere, and then runs the actual roxygenise on them?
r roxygen2
mathematical.coffee Mar 21 '13 at 5:42 on 2013-03-21 05:42
source share