htmlize allows the user to produce a basic HTML listing from
an existing R script. The script must already run correctly with
source. If the first line of the R script is a comment starting
with #title~ and the title argument is missing, the rest
of the first line will be used as the title of the HTML output.
If there is any graphic output, the script must contain the necessary
commands to set up the graphic devices. Note that only TIFF, GIF, BMP,
JPEG and PNG graphic images are generally viewable in HTML browsers.
The last two are probably the most reliable, but see their help pages
for more details. The graphic files will be linked to the HTML listing
page so that they should be interleaved with text output and commands.
If do.nav is TRUE, three files will be output. The first will
be named HTMLbase.html, where HTMLbase is whatever string
has been passed as that argument.
If that argument is missing, the function will attempt to munge the
Rfile argument into a base name. This file is an "index" file
that sets up the HTML frameset. The second file will be named
HTMLbase_nav.html and will be dispayed at the left side of the HTML
output as a "navigation" list using the commands as names. Commands
longer than 20 characters will be truncated. The third file, named
HTMLbase_list.html, contains the program listing. All three
files will be written in HTMLdir. If this is missing, the path of
Rfile will be used.
If do.nav is FALSE, only one file will be written. It will have
the same content as the HTMLbase_list.html file except without
the name tags for navigation and it will be named HTMLbase.html.
Commands that create or alter connections, such as sink are
"forbidden", not evaluated and marked as comments in the listing.
This prevents such commands from altering the connections necessary
to write the HTML files.
If there is a function defined in the R script, htmlize will run, but
not write any output after the function definition. This has to do with the
way that htmlize reads command lines from the script file. This is a
bug, so watch this space for a solution.
The ability to nominate a CSS stylesheet allows the user to customize the
appearance of the HTML output. The most likely use of the useCSS
argument is for the user to specify whatever aspects of the HTML display
are to be different from the default browser values in a stylesheet.