Skip to content
Prev 26420 / 63424 Next

Sweave/ESS-like tools for HTML

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Doug.

  This is probably more than you want - either to know or to use
for your specific task, but I'll throw it out there for general
information.

 I write documents using XML, specifically an extended version
of Docbook with elements for describing R concepts (e.g.
code, plot, output, function name, argument, ...).  Then,
I use XSL to transform this to either HTML, FO and on to PDF,
or to LaTeX (via db2latex).  As for processing
the R code and inserting the output into the resulting view/document,
I use the Sxslt package from within R which allows me to combine XSL
rules with those that also call R functions.
I author the documents using the nxml mode in emacs
and have some basic "gestures" for sending code from the document
to R.


Deb Nolan and I use this for creating dynamic and interactive
documents which can be transformed to HTML with embedded
controls for the reader to control the R computations
interactively.

Rather than thinking of the document as being one whose
primary purpose is to be displayed to readers,
the approach allows us to put arbitrary things into the
document as part of our work but render only the bits
we want for a particular audience, e.g. mix code,
pedagogical material, R documentation, data, code
from other languages.

The XML/Docbook-XSL-R approach is very general and flexible
with possibly "too" many degrees of freedom.  If the document is
destined only for HTML, then writing in HTML directly may be
best. The generality is useful when there are multiple targets
and one wants to extract information programmatically, e.g.
extract subsets of the code within the document such as
that in section 2, or only Matlab code.

I will be packaging up all the material we have on this soon,
so if anyone wants a copy, let me know.


  D.
Douglas Bates wrote:
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHFRgR9p/Jzwa2QP4RAi2vAJ0S+Mnbjvt6z9pe1kPoIxHeaaZQkACggHOL
GflkuedfvPVQfm6fayigGK0=
=4fKz
-----END PGP SIGNATURE-----