TROFF2HTML(1)

NAME
troff2html - convert troff/groff input to html

SYNOPSIS
troff2html [ -i option-file ] [ -m macro-package ] [ -o option=value ] [ -r registervalue ] [ -s script ] [ -v ] [ -I directory ] [ file ... ]

DESCRIPTION
troff2html converts input troff(1) (or groff(1), depending on the processing mode) documents to an HTML document on the standard output. Although troff2html does a full troff(1) parse, many troff features are ignored in the mapping to HTML. The troff `t' condition test evaluates true (and the `n' condition test evaluates false), and the groff compatibility register \\n[.C] evaluates to 0 (enable groff parsing) if it is referenced before the first groff .cp (compatibility mode) directive.

The generated HTML has properly nested begin/end tags, even though most browsers don't care.

  Options

-i file
    Reads option=value settings from file. See -o for a description of the option names. Unknown options in file are ignored.

-m package
    Locates and reads the macro package file package. In order to accomodate different troff installation styles the file search order is fairly involved:

    (1) ./package

    (2) directory/package for all -I directories.

    (3) directory/tmac.package for all -I directories.

    (4) ../lib/tmac/tmac.package for all directories on $PATH.

    (5) ../lib/html/package for all directories on $PATH.

    (6) ../lib/html/mpackage.tr for all directories on $PATH.

-o[no]option[=value...]
    Sets options by name. If no is specified then value is ignored and the option is turned off. If value contains space characters then it must be "..." quoted. Some options may only be set using the troff2html .xx directive (below). The options are:

    author=text
        Sets the author contact information that is placed in the document HEAD section.

    background=URL
        The URL of the document background.

    debug=level
        Sets the debug trace level to level. Higher levels produce more output.

    footnote=char
        (.xx only) Starts a footnote body. The last word emitted before
            .xxfootnote=char
        is the footnote hot link text.
            .xxnofootnote
        ends the footnote body.

    get=[+|-]register [...]
        Traces each ``get'' for the named number registers. - turns the tracing off.

    hot=[+|-]hot-word [..."]
        Adds (+) or removes (-) words from the hot-word list. Constructs that match
            (hot-wordP ... switch-font text switch-font ... )
        adds text as a hot link to another portion of the document. refer and see are the default hot words.

    label=label
        (.xx only) Emits an HTML anchor NAME=label.

    link=[url\t]text
        (.xx only) Emits an HTML reference HREF=url with hot link text. If url is omitted then it is the same as text.

    logo=URL
        Sets the URL of the logo/banner image that is centered at the top of the document.

    mailto=address
        Sets the address to send comments and suggestions.

    meta.name=content
        Emits the HTML tag <META NAME=name CONTENT=content>.

    package=text
        Prepended to the HTML document title.

    set=[+|-]register [...]
        Traces each ``set'' for the named number registers. - turns the tracing off.

    test=bitmask
        Adds bitmask to the internal test bitmask. Described here for completeness; use at your own risk (i.e., read the source).

    title=text
        Sets the HTML document title.

-r registervalue
    Sets the number register named by the single character register to the numeric expression value.

-s script
    Reads script as if it came from a file. For example, the following two options are equivalent:
        -s ".nr A 123"
        -r A123

-v  Enables verbose error and warning messages. Following troff tradition, troff2html by default does not warn about unknown requests; -v enables such warnings.

-I directory
    Appends directory to the list of directories to be searched to locate -m and .so files.

  Extensions
.xx is a special troff2html request that handles program tracing, HTML extensions and troff macro package magic that went way past the author's willingness to understand. The syntax is:
    .xx [no]name[=value]
where name and value are described under the -o option above.

Local URL links are generated for all top level headings. These can be referenced by embedding the benign (albeit convoluted) troff construct:
    \h'0*\w"label"'text\h'0'
where label is the local link label and text is the hot link text. Use the following if text and label are the same:
    \h'0*1'text\h'0'
Labels may be added by changing * to / in the above constructs.

SEE ALSO
groff(1), html2rtf(1), man(1), mm(1), mm2html(1), troff(1)