SGMLFMT(1)

NAME
sgmlfmt - Formats linuxdoc and DocBook SGML documents.

SYNOPSIS
sgmlfmt [-d doctype] -f format [-i name ...] [-links] [-e encoding] [-hdr file] [-ftr file] file

DESCRIPTION
The sgmlfmt command reads SGML files tagged according to the linuxdoc or DocBook DTD, validates them using the sgmls(1) parser and then converts them to the specified output format. Linuxdoc input files must include the following document type declaration before any uncommented text:

    <!DOCTYPE linuxdoc PUBLIC "-//FreeBSD//DTD linuxdoc//EN">

Options for sgmlfmt include the following:

-d doctype
    Specifies the SGML document type of the source file. Currently supported document types are linuxdoc and docbook. If no -d option is specified, the default is linuxdoc.

-f format
    Determines the output format which can be one of the following:

    ascii
        Generates a single output file with the extension .ascii suitable for viewing on an ASCII terminal.

    html
        Generates a set of linked HTML files suitable for use with an HTML browser. A top level file, file.html, contains the title, author, date, abstract and brief table of contents for the document. A file file_toc.html contains a complete table of contents. A series of files named file1.html, file2.html ... filen.html contain the actual text of the document.

    koi8-r
        Generates a single output file with the extension .koi8-r suitable for viewing on an terminal supporting the KOI8-R character encoding.

    latin1
        Generates a single output file with the extension .latin1 suitable for viewing on an terminal supporting the ISO8859-1 character encoding.

    ps  Generates a single output file with the extension .ps suitable for printing or display on a PostScript compatible device.

    roff
        Generates a single output file with the extension .roff suitable processing with groff(1). This is actually an intermediate conversion used by the -f ascii, -f latin1, -f koi8-r, and -f ps format options.

-i name
    Pretend that
        <!ENTITY % name INCLUDE >
    occurs at the start of the document type declaration subset in the document entity. Since repeated definitions of an entity are ignored, this definition will take precedence over any other definitions of this entity in the document type declaration. Multiple -i options are allowed. If the declaration replaces the reserved name INCLUDE then the new reserved name will be the replacement text of the entity. Typically the document type declaration will contain
        <!ENTITY % name IGNORE >
    and will use %name; in the status keyword specification of a marked section declaration. In this case the effect of the option will be to cause the marked section not to be ignored.

-links
    When used with the -f html option, this option generates a shell script named file.ln. For each <label id="foo"> in the document source, file.ln generates a symbolic link foo.html pointing to the numbered .html file containing the reference. Since the number of the file containing a particular section can change when a document is modified, this provides a convenient hook by which separate documents can provide links into another document without the links becoming invalid when the target document is modified. When creating a symbolic link, any occurrence of a slash (/) in label is replaced with percent (%), while any occurrence of a space is replaced with an underscore (_).

-e encoding
    When used with the -f html option, specifies document encoding to use for the generated HTML files. If this option is not specified, iso-8859-1 is used.

-hdr file
    When used with the -f html option, the specified file will be inserted at the beginning of the body element of each generated HTML file.

-ftr file
    When used with the -f html option, the specified file will be inserted at the end of the body element of each generated HTML file.

In all cases, the output files are created in the current working directory.

FILES
/usr/share/sgml/transpec - directory containing translation specification files for instant(1).

SEE ALSO
groff(1), instant(1), sgmls(1), transpec(5)

HISTORY
The sgmlfmt command appeared in Version 2.0.5 FreeBSD UNIX.

AUTHORS
The sgmlfmt command was written by John Fieber <jfieber@FreeBSD.org>. The linuxdoc DTD was written by Matt Welsh <mdw@cs.cornell.edu> and based on the Qwertz DTD written by Tom Gordon <thomas.gordon@gmd.de>.