Rd2HTML                package:tools                R Documentation

_W_o_r_k _w_i_t_h _a_n _R_d _o_b_j_e_c_t

_D_e_s_c_r_i_p_t_i_o_n:

     These experimental functions take the output of the 'parse_Rd'
     function and check it or produce a help page from it.  Their
     interfaces (and existence!) are subject to change.

_U_s_a_g_e:

     Rd2HTML(Rd, out = "", package = "", defines = .Platform$OS.type,
             encoding = "unknown", Links = NULL, CHM = FALSE)

     Rd2txt(Rd, out = "", package = "", defines = .Platform$OS.type)

     Rd2latex(Rd, out = "", defines = .Platform$OS.type, encoding = "unknown")

     Rd2ex(Rd, out = "", defines = .Platform$OS.type, encoding = "unknown")

     checkRd(Rd, defines = .Platform$OS.type, encoding = "unknown",
             unknownOK = FALSE, listOK = TRUE)

     findHTMLlinks(pkgDir = "", lib.loc = NULL)

_A_r_g_u_m_e_n_t_s:

      Rd: the 'Rd' object. 

     out: a filename or connection object to which to write the output. 

 package: the package to list in the output. 

 defines: string(s) to use in '"#ifdef"' tests. 

encoding: encoding to use if the file does not specify one. 

   Links: 'NULL' or a named (by topics) character vector of links, as
          returned by 'findHTMLlinks'.

     CHM: logical: prepare HTML suitable for Compiled HTML?

unknownOK: unrecognized macros are treated as errors if 'FALSE',
          otherwise warnings. 

  listOK: unnecessary non-empty braces (e.g. around text, not as an
          argument) are treated as errors if 'FALSE', otherwise
          warnings. 

  pkgDir: The top-level directory of an installed package.

 lib.loc: character vector describing the location of R library trees
          to scan: the default indicates '.libPaths()'.

_D_e_t_a_i_l_s:

     The 'Rd2HTML' converter is still in development, and currently has
     the following known deficiencies:

        *  '"\enc"' is not supported.

        *  Error messages are not as informative as they could be. 
           Often using 'parse_Rd(..., verbose = TRUE)' will give a
           better idea of what is wrong.

        *  Formatting is not always optimal.

     'Rd2ex' extracts the examples in the format used by 'example' and
     R utilities.  it reproduces the previous version up to

        *  The parser does not interpret markup in R comments: this
           used to be done.

        *  Small improvements in layout.

     'findHTMLlinks' uses in decreasing priority

        *  The package in 'pkgDir': this is used when converting HTML
           help for that package.

        *  The packages that are loaded in a vanilla R session.

        *  Other packages found in the library trees specified by
           'lib.loc' in the order of the trees and alphabetically
           within a library tree.

_V_a_l_u_e:

     'Rd2*' are executed mainly for the side effect of writing the
     converted help page.  Its value is the name of that page.

     'checkRd' returns 'TRUE' if the file has no errors; it generates
     an R error otherwise.

     'findHTMLlinks' returns a namesd character vector of relative file
     paths, in the same package or in a package in the same library
     tree.

_A_u_t_h_o_r(_s):

     Duncan Murdoch, Brian Ripley

_R_e_f_e_r_e_n_c_e_s:

     <URL: http://developer.r-project.org/parseRd.pdf>

_S_e_e _A_l_s_o:

     'parse_Rd'

_E_x_a_m_p_l_e_s:

     toolsRd <- Rd_db("tools")
     con <- textConnection(toolsRd[[grep("Rd2HTML.Rd", names(toolsRd))]], "rt")
     outfile <- paste(tempfile(), ".html", sep="")
     browseURL(Rd2HTML(con, outfile, package="tools"))
     close(con)
      
     con <- textConnection(toolsRd[["Rd2HTML.Rd"]], "rt")
     checkRd(con) # A stricter test than Rd2HTML uses
     close(con)

