Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jokergoo/rhydrogen

translate comments to documentation in R
https://github.com/jokergoo/rhydrogen

Last synced: 24 days ago
JSON representation

translate comments to documentation in R

Awesome Lists containing this project

README

        

## 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...}
}
}