hadley wickham wrote:
It would be pretty easy to use the output from the R parser (which is never
wrong, is it?), and dump some markup out of it. For example the showTree
function in codetools dumps an R expression as Lisp, this is not too far
from generating html, or any other markup.

As this sounds like fun, I'll volunteer to do something about this. Another
advantage is that we can imagine to plug hyperlinks in  R code that lives in
html help pages.

This also sounds like a good idea for a google summer of code project
- that way you might be able to get a student to give you a hand as
well.

Hadley
That did cross my mind earlier this evening, it just seems a bit too easy to last all summer, but maybe I am missing something difficult. I will start to play with this over the next few days, and make up my mind.

One of the problem I might run into is performance, if we want this to treat all Rd files, we are going to want something very efficient, and it might not be enough to build on top of codetools (which uses recursion at the R level) , but could make sense to provide a C level implementation.

This could lead to interesting things as:
- syntax highlighting in sweave (or decumar)
- pretty printing in the console (using ansi characters)
- syntax highlighting in R help files, potentially with hyperlinks

I have requested creation of a project on r-forge. Anyone else want to play with this ?

Romain

--
Romain Francois
Independent R Consultant
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to