translate comments to documentation in R
Perl R
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib/R
t
test/test_package
.gitignore
README.md
hydrogenize.pl

README.md

Translate comments to documentations in R

Comments are marked as Markdown-style.

Now it supports S3 methods, S4 methods and S4 classes.

The module can be run as:

perl hydrogenize.pl your-package-directory

An example of the comment of a function is:

# == title
# title of the function
#
# == param
# -x a value returned by `function`
# -y a value returned by `package::function2`. If ``x`` is a list, then ...
#
# == details
# first line, blablabla...
#
# - item1...
# - item2...
#
# -item1 named item1...
# -item2 named itme2...
#
f = function(x, y) {
}

would be converted to

\name{f}
\alias{f}
\title{
  title of the function
}
\description{
  title of the function
}
\usage{
f(x, y)
}
\arguments{
  \item{x}{a value returned by \code{\link{function}}}
  \item{y}{a value returned by \code{\link[package]{function2}}. If \code{x} is a list, then ...}
}
\details{
  first line, blablabla...
  \itemize{
    \item item1...
    \item item2...
  }
  \describe{
    \item{item1}{named item1...}
    \item{item2}{named itme2...}
  }
}