I use ST for R development. A popular package called roxygen (roxygen.org/) provides a way to document functions inline so it makes it super easy to generate final documentation when packaging a set of functions. I was wondering if someone could give me advice on how I would write a ST plugin to generate documentation templates. Here is an example:
Let’s say I have a simple function like so:
test_function <- function(a,b)
{
a+b
}
then, the (basic) roxygen markup for this functions would look like so:
#'
#' <description>
#' @param a <description>
#' @param b <description>
test_function <- function(a,b)
{
a+b
}
I would like to write a plugin (or macro if that’s what it would be called in this context) to automatically generate the template. I select the function and it could automatically generate the above based on what’s in the function(…)
Note that the is just (my) place holder to indicate that one could (but does not have to) describe what that parameter (or function in the case of the top most line) does.
Ideas or suggestions?
thanks.