Annotation of mandoc/mdocml.1, Revision 1.20
1.1 kristaps 1: .\"
1.2 kristaps 2: .Dd $Mdocdate$
1.17 kristaps 3: .Dt mdocml 1 alpha
1.1 kristaps 4: .Os
1.3 kristaps 5: .\"
1.1 kristaps 6: .Sh NAME
1.2 kristaps 7: .Nm mdocml
8: .Nd compile manpage source into mark-up language
1.3 kristaps 9: .\"
1.1 kristaps 10: .Sh SYNOPSIS
1.2 kristaps 11: .Nm mdocml
1.17 kristaps 12: .Op Fl vW
1.7 kristaps 13: .Op Fl f Ar filter
1.2 kristaps 14: .Op Fl o Ar outfile
15: .Op Ar infile
1.3 kristaps 16: .\"
1.1 kristaps 17: .Sh DESCRIPTION
18: The
19: .Nm
1.13 kristaps 20: utility parses mdoc formatted manual source and passes results into an
1.17 kristaps 21: output filter. The current output filters are
22: .Ar html
23: and
1.10 kristaps 24: .Ar xml ,
1.17 kristaps 25: the default. Arguments common to all filters follow:
1.10 kristaps 26: .Bl -tag -width "\-o outfile"
27: .It Fl f Ar filter
1.12 kristaps 28: The output filter name.
1.10 kristaps 29: .It Fl o Ar outfile
1.12 kristaps 30: Write output to
1.2 kristaps 31: .Ar outfile ,
32: which may be
1.6 kristaps 33: .Qq \-
1.12 kristaps 34: for stdout.
1.10 kristaps 35: .It Fl W
1.12 kristaps 36: Print warnings to stderr.
1.2 kristaps 37: .It Ar infile
38: Read input from
39: .Ar infile ,
40: which may be
1.6 kristaps 41: .Qq \-
1.12 kristaps 42: for stdin.
1.2 kristaps 43: .El
1.12 kristaps 44: .Pp
45: By default,
46: .Nm
47: reads from stdin and writes to stdout using the xml filter.
1.20 ! kristaps 48: .Pp
! 49: .Ex -std mdocml
1.12 kristaps 50: .\"
1.10 kristaps 51: .Ss XML Filter
52: The XML filter, specified by
53: .Fl f Ar xml ,
1.17 kristaps 54: is the default filter. This filter has no additional arguments.
55: .Pp
56: The XML filter creates an XML document where element names are their respective
57: roff macro names. Each element name has an associated
1.10 kristaps 58: namespace, which is one of
1.16 kristaps 59: .Qq block ,
60: .Qq head ,
61: .Qq body ,
1.12 kristaps 62: or
1.10 kristaps 63: .Qq inline ,
1.12 kristaps 64: corresponding to the display mode of a node. The document root is
65: always the
66: .Qq mdoc
1.17 kristaps 67: element, in the default namespace; the
68: .Qq head
69: namespace is for block headers (such as
70: .Sq .Ss
71: and
72: .Sq .Sh ) ;
73: the
74: .Qq body
75: namespace is for block bodies; and the
76: .Qq inline
77: namespace is for in-line elements (such as
78: .Sq .Em ) .
79: .Ss HTML Filter
80: The HTML filter, specified by
81: .Fl f Ar html ,
82: accepts the following filter-specific arguments:
83: .Bl -tag -width "\-c css"
84: .It Fl c Ar css
85: The CSS file location, which defaults to
86: .Ar mdocml.css .
87: .It Fl e
88: Whether to embed the CSS file into the HTML prologue.
89: .El
1.18 kristaps 90: .\"
1.17 kristaps 91: .Sh EXAMPLES
92: To produce an HTML4-strict document
93: .Pa mdocml.html
94: for
95: .Pa mdocml.1
96: with the default, embedded style-sheet:
97: .Pp
1.18 kristaps 98: .D1 % mdocml -fhtml -e -o mdocml.html mdocml.1
1.17 kristaps 99: .Pp
100: To create an XML document on standard output from
101: .Pa mdocml.1
102: with the default namespace identifiers
103: .Li head ,
104: .Li body ,
105: .Li block
106: and
107: .Li inline :
108: .Pp
109: .D1 % mdocml mdocml.1
1.12 kristaps 110: .\"
1.3 kristaps 111: .Sh SEE ALSO
112: .Xr groff 1 ,
113: .Xr mdoc.samples 7 ,
114: .Xr mdoc 7
1.1 kristaps 115: .\" .Sh STANDARDS
116: .\" .Sh HISTORY
1.3 kristaps 117: .Sh AUTHORS
118: The
119: .Nm
120: utility was written by
1.9 kristaps 121: .An Em Kristaps Dzonsons Aq kristaps@kth.se .
1.3 kristaps 122: .\"
123: .Sh CAVEATS
1.7 kristaps 124: Most caveats of
1.3 kristaps 125: .Nm
1.7 kristaps 126: stem from ambiguities in
127: .Xr mdoc 7
128: or the necessary limitations of converting an ad hoc language into
129: structured ones:
130: .Bl -enum -compact -offset indent
131: .It
1.12 kristaps 132: The engine doesn't understand the
133: .Sq \&No ,
134: .Sq \&Db ,
135: .Sq \&Xc ,
136: and
1.3 kristaps 137: .Sq \&Xo
1.12 kristaps 138: mdoc macros.
1.7 kristaps 139: .It
140: All macro arguments may be quoted, instead of only some.
141: .It
1.12 kristaps 142: Blank lines raise errors.
1.7 kristaps 143: .It
1.9 kristaps 144: If terminating punctuation is found, then
145: .Em all
146: remaining tokens are flushed after line scope is closed, not just the
147: last one.
1.7 kristaps 148: .El
1.14 kristaps 149: .Pp
150: The roff engine in
151: .Nm
152: produces text in-line; thus, output may already be partially written by
153: the time an error is encountered.
1.1 kristaps 154: .\" .Sh BUGS
CVSweb