Annotation of mandoc/mdocterm.1, Revision 1.19
1.19 ! kristaps 1: .\" $Id: mdocterm.1,v 1.18 2009/03/12 02:57:36 kristaps Exp $
1.1 kristaps 2: .\"
3: .\" Copyright (c) 2009 Kristaps Dzonsons <kristaps@kth.se>
4: .\"
5: .\" Permission to use, copy, modify, and distribute this software for any
6: .\" purpose with or without fee is hereby granted, provided that the
7: .\" above copyright notice and this permission notice appear in all
8: .\" copies.
9: .\"
10: .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11: .\" WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12: .\" WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13: .\" AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14: .\" DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15: .\" PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16: .\" TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17: .\" PERFORMANCE OF THIS SOFTWARE.
18: .\"
19: .Dd $Mdocdate$
1.14 kristaps 20: .Dt mdocterm 1
1.1 kristaps 21: .Os
22: .\" SECTION
23: .Sh NAME
24: .Nm mdocmterm
25: .Nd mdoc macro compiler
26: .\" SECTION
27: .Sh SYNOPSIS
28: .Nm mdocmterm
1.15 kristaps 29: .Op Fl vV
30: .Op Fl f Ns Ar option...
1.1 kristaps 31: .Op Fl W Ns Ar err...
32: .Op Ar infile
33: .\" SECTION
34: .Sh DESCRIPTION
35: The
36: .Nm
37: utility formats a BSD
38: .Dq mdoc
39: manual page for display on the terminal. The arguments are as follows:
1.15 kristaps 40: .Bl -tag -width XXXXXXXXXXXX
1.1 kristaps 41: .\" ITEM
42: .It Fl v
43: Print verbose parsing output.
44: .\" ITEM
1.15 kristaps 45: .It Fl v
46: Print version and exit.
47: .\" ITEM
48: .It Fl f Ns Ar option...
49: Override default compiler behaviour. See
50: .Sx Compiler Options
51: for details.
52: .\" ITEM
1.1 kristaps 53: .It Fl W Ns Ar err...
54: Print warning messages. May be set to
55: .Fl W Ns Ar all
56: for all warnings,
57: .Ar compat
58: for groff/troff-compatibility warnings, or
59: .Ar syntax
60: for syntax warnings. If
61: .Fl W Ns Ar error
62: is specified, warnings are considered errors and cause utility
63: termination. Multiple
64: .Fl W
65: arguments may be comma-separated, such as
66: .Fl W Ns Ar error,all .
67: .\" ITEM
68: .It Ar infile
69: Read input from
70: .Ar infile ,
71: which may be
72: .Dq \-
73: for stdin.
74: .El
75: .\" PARAGRAPH
1.2 kristaps 76: .Pp
1.1 kristaps 77: The
78: .Nm
79: utility is a formatting front-end for
80: .Xr mdoc 3 ,
81: which parses the
82: .Dq mdoc
83: input, documented at
84: .Xr mdoc 7
85: and
86: .Xr mdoc.samples 7 ,
1.15 kristaps 87: into an abstract syntax tree.
1.1 kristaps 88: .Pp
1.15 kristaps 89: By default,
90: .Nm
91: reads from stdin and prints ANSI
92: .Qq raw
93: terminal-encoded output to stdout, at this time to a fixed column with
94: of 78 characters.
1.1 kristaps 95: .\" PARAGRAPH
96: .Pp
97: .Ex -std mdocmterm
1.15 kristaps 98: .\" SUB-SECTION
99: .Ss Compiler Options
100: Default compiler behaviour may be overriden with the
101: .Fl f
102: flag. The available options are as follows:
103: .Bl -tag -width XXXXXXXXXXXX -offset XXXX
104: .It Fl f Ns Ar ign-scope
105: When rewinding the scope of a block macro, forces the compiler to ignore
106: scope violations. This can seriously mangle the resulting tree.
107: .It Fl f Ns Ar ign-escape
108: Ignore invalid escape sequences.
1.16 kristaps 109: .It Fl f Ns Ar ign-macro
110: Ignore unknown macros at the start of input lines.
1.15 kristaps 111: .El
1.1 kristaps 112: .\" PARAGRAPH
113: .Pp
1.15 kristaps 114: As with the
115: .Fl W
116: flag, multiple
117: .Fl f
118: options may be grouped and delimited with a comma. Using
119: .Fl f Ns Ar ign-scope,ign-escape ,
120: for example, will try to ignore scope and character-escape errors.
1.7 kristaps 121: .\" SUB-SECTION
1.16 kristaps 122: .Ss Input Encoding
123: The
124: .Nm
125: utility expects its input to be 7-bit ASCII as defined in
126: .Xr ascii 7 .
127: The only non-graphing characters accepted are spaces,
128: .Sq \ ,
129: and tabs,
130: .Sq \et .
131: Tabs are only accepted in literal block-displays and as column
132: delimiters.
133: .Pp
134: Only Unix-style newlines (\en) are accepted; if the newline is escaped,
135: the line is concatenated with the next.
136: .\" SUB-SECTION
1.7 kristaps 137: .Ss Character Escapes
138: This section documents the character-escapes accepted by
139: .Xr mdocterm 1 .
1.10 kristaps 140: Note that the \\x, \\(xx and \\[n] forms are described here; the \\*(xx,
141: \\*[n] and \\*x forms described in
1.7 kristaps 142: .Xr mdoc.samples 7
1.10 kristaps 143: are deprecated, but still rendered. All one- and two-character
144: sequences may be used in the n-character sequence \\[n].
1.7 kristaps 145: .Pp
146: Note that the
147: .Em Output
148: column will render differently whether executed with
149: .Xr mdocterm 1
150: or another output filter.
151: .\" PARAGRAPH
152: .Pp
1.10 kristaps 153: Grammatic:
154: .Pp
155: .Bl -tag -width "OutputXXXX" -offset "XXXX" -compact
156: .It Em Output
157: .Em Input (Name)
158: .It \(em
159: \\(em (em-dash)
160: .It \(en
161: \\(en (en-dash)
162: .It \-
163: \\- (hyphen)
164: .It \\
1.13 kristaps 165: \\\\ (back-slash)
1.10 kristaps 166: .El
167: .\" PARAGRAPH
168: .Pp
1.7 kristaps 169: Enclosures:
170: .Pp
171: .Bl -tag -width "OutputXXXX" -offset "XXXX" -compact
172: .It Em Output
173: .Em Input (Name)
1.17 kristaps 174: .It \(rC
175: \\(rC (right brace)
176: .It \(lC
177: \\(lC (left brace)
1.13 kristaps 178: .It \(ra
179: \\(ra (right angle)
180: .It \(la
181: \\(la (left angle)
1.7 kristaps 182: .It \(rB
183: \\(rB (right bracket)
184: .It \(lB
1.13 kristaps 185: \\(lB (left bracket)
1.19 ! kristaps 186: .It \q
! 187: \\q (double-quote)
1.7 kristaps 188: .It \(lq
189: \\(lq (left double-quote)
190: .It \(rq
1.13 kristaps 191: \\(rq (right double-quote)
1.7 kristaps 192: .It \(oq
1.13 kristaps 193: \\(oq, \\` (left single-quote)
1.7 kristaps 194: .It \(aq
1.13 kristaps 195: \\(aq, \\' (right single-quote, apostrophe)
1.7 kristaps 196: .El
197: .\" PARAGRAPH
198: .Pp
199: Indicatives:
200: .Pp
201: .Bl -tag -width "OutputXXXX" -offset "XXXX" -compact
202: .It Em Output
203: .Em Input (Name)
204: .It \(<-
205: \\(<- (left arrow)
206: .It \(->
207: \\(-> (right arrow)
208: .It \(ua
209: \\(ua (up arrow)
210: .It \(da
211: \\(da (down arrow)
212: .El
213: .\" PARAGRAPH
214: .Pp
215: Mathematical:
216: .Pp
217: .Bl -tag -width "OutputXXXX" -offset "XXXX" -compact
218: .It Em Output
219: .Em Input (Name)
220: .It \(<=
221: \\(<= (less-than-equal)
222: .It \(>=
223: \\(>= (greater-than-equal)
224: .It \(==
1.13 kristaps 225: \\(== (equal)
1.7 kristaps 226: .It \(!=
227: \\(!= (not equal)
228: .It \(if
229: \\(if (infinity)
230: .It \(na
231: \\(na (NaN)*
232: .It \(+-
233: \\(+- (plus-minus)
1.10 kristaps 234: .It \(**
235: \\(** (asterisk)
1.7 kristaps 236: .El
237: .\" PARAGRAPH
238: .Pp
239: Diacritics:
240: .Pp
241: .Bl -tag -width "OutputXXXX" -offset "XXXX" -compact
242: .It Em Output
243: .Em Input (Name)
244: .It \(ga
245: \\(ga (accent grave)
246: .It \(aa
247: \\(aa (accent accute)
248: .El
249: .\" PARAGRAPH
250: .Pp
251: Special symbols:
252: .Pp
253: .Bl -tag -width "OutputXXXX" -offset "XXXX" -compact
254: .It Em Output
255: .Em Input (Name)
256: .It \(bu
257: \\(bu (bullet)
258: .It \(ba
259: \\(ba (bar)
1.10 kristaps 260: .It \(co
261: \\(co (copyright)
1.7 kristaps 262: .El
1.10 kristaps 263: .Pp
264: *This is a deviation from the standard, as NaN is usually rendered as
265: \\*(Na, which is a deprecated form. We introduce \\(na, which follows
266: the more general syntax.
1.1 kristaps 267: .\" SECTION
268: .Sh EXAMPLES
269: To display this manual page:
270: .\" PARAGRAPH
271: .Pp
272: .D1 % mdocmterm \-Wall,error mdocmterm.1
1.2 kristaps 273: .\" PARAGRAPH
274: .Pp
275: To pipe a manual page to the pager:
276: .Pp
1.15 kristaps 277: .D1 % mdocterm mdocterm.1 2>&1 | less \-R
1.1 kristaps 278: .\" SECTION
279: .Sh SEE ALSO
280: .Xr mdoctree 1 ,
1.3 kristaps 281: .Xr mdoclint 1 ,
1.1 kristaps 282: .Xr mdoc.samples 7 ,
283: .Xr mdoc 7 ,
284: .Xr mdoc 3
285: .\"
286: .Sh AUTHORS
287: The
288: .Nm
289: utility was written by
290: .An Kristaps Dzonsons Aq kristaps@kth.se .
291: .\" SECTION
292: .Sh CAVEATS
293: See
294: .Xr mdoc 3
1.4 kristaps 295: for a list of bugs, caveats, and incomplete macros regarding the
296: document parse.
1.9 kristaps 297: .Pp
298: The
299: .Nm
300: utility doesn't yet know how to display the following:
301: .Pp
302: .Bl -bullet -compact
303: .It
1.18 kristaps 304: The \-hang
1.9 kristaps 305: .Sq \&Bl
1.18 kristaps 306: list is not yet supported.
1.9 kristaps 307: .It
308: The \-literal and \-unfilled
309: .Sq \&Bd
310: displays only accept text contents.
311: .It
312: The
313: .Sq \&Xo/Xc
314: pair isn't supported (and never will be).
1.12 kristaps 315: .It
316: The
317: .Sq \&Sm
318: macro has no effect, yet.
1.9 kristaps 319: .El
CVSweb