Annotation of mandoc/mdoc.7, Revision 1.24
1.24 ! kristaps 1: .\" $Id: mdoc.7,v 1.23 2009/06/10 20:18:43 kristaps Exp $
1.1 kristaps 2: .\"
1.23 kristaps 3: .\" Copyright (c) 2009 Kristaps Dzonsons <kristaps@kth.se>
1.1 kristaps 4: .\"
5: .\" Permission to use, copy, modify, and distribute this software for any
1.22 kristaps 6: .\" purpose with or without fee is hereby granted, provided that the above
7: .\" copyright notice and this permission notice appear in all copies.
1.1 kristaps 8: .\"
1.22 kristaps 9: .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10: .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11: .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12: .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13: .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14: .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15: .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1.1 kristaps 16: .\"
17: .Dd $Mdocdate$
1.20 kristaps 18: .Dt MDOC 7
1.1 kristaps 19: .Os
20: .\" SECTION
21: .Sh NAME
22: .Nm mdoc
1.15 kristaps 23: .Nd mdoc language reference
1.1 kristaps 24: .\" SECTION
25: .Sh DESCRIPTION
26: The
27: .Nm mdoc
28: language is used to format
29: .Bx
30: .Ux
1.13 kristaps 31: manuals. In this reference document, we describe the syntax, ontology
32: and structure of the
33: .Nm
34: language.
35: .\" PARAGRAPH
36: .Pp
37: An
1.1 kristaps 38: .Nm
39: document follows simple rules: lines beginning with the control
1.13 kristaps 40: character
1.1 kristaps 41: .Sq \.
42: are parsed for macros. Other lines are interpreted within the scope of
1.13 kristaps 43: prior macros:
44: .Bd -literal -offset XXX
45: \&.Sh Macro lines change control state.
46: Other lines are interpreted within the current state.
47: .Ed
1.1 kristaps 48: .\" SECTION
1.13 kristaps 49: .Sh INPUT ENCODING
1.1 kristaps 50: .Nm
1.13 kristaps 51: documents may contain only graphable 7-bit ASCII characters, the space
52: character
1.1 kristaps 53: .Sq \ ,
54: and, in certain circumstances, the tab character
55: .Sq \et .
56: All manuals must have
57: .Sq \en
1.10 kristaps 58: line termination.
59: .Pp
60: The only time a blank line is acceptable is within
61: the context of
1.16 kristaps 62: .Sq \&.Bd \-literal
1.10 kristaps 63: or
1.16 kristaps 64: .Sq \&.Bd \-unfilled .
1.10 kristaps 65: .Pp
66: Tab characters
67: .Pq \et
68: are only acceptable when delimiting
1.16 kristaps 69: .Sq \&.Bl \-column
1.10 kristaps 70: and in
1.16 kristaps 71: .Sq \&.Bd \-literal
1.10 kristaps 72: or
1.16 kristaps 73: .Sq \&.Bd \-unfilled
1.10 kristaps 74: contexts.
1.1 kristaps 75: .\" SUB-SECTION
1.2 kristaps 76: .Ss Reserved Characters
77: Within a macro line, the following characters are reserved:
78: .Bl -tag -width 12n -offset XXXX -compact
1.1 kristaps 79: .It \&.
1.2 kristaps 80: .Pq period
1.1 kristaps 81: .It \&,
1.2 kristaps 82: .Pq comma
1.1 kristaps 83: .It \&:
1.2 kristaps 84: .Pq colon
1.1 kristaps 85: .It \&;
1.2 kristaps 86: .Pq semicolon
1.1 kristaps 87: .It \&(
1.2 kristaps 88: .Pq left-parenthesis
1.1 kristaps 89: .It \&)
1.2 kristaps 90: .Pq right-parenthesis
1.1 kristaps 91: .It \&[
1.2 kristaps 92: .Pq left-bracket
1.1 kristaps 93: .It \&]
1.2 kristaps 94: .Pq right-bracket
1.1 kristaps 95: .It \&?
1.2 kristaps 96: .Pq question
1.1 kristaps 97: .It \&!
1.5 kristaps 98: .Pq exclamation
1.1 kristaps 99: .El
1.5 kristaps 100: .\" PARAGRAPH
1.1 kristaps 101: .Pp
1.5 kristaps 102: Use of reserved characters is described in
103: .Sx Closure .
104: For general non-reserved use, characters must either be escaped with a
105: non-breaking space
1.1 kristaps 106: .Pq Sq \e&
1.5 kristaps 107: or, if applicable, an appropriate escape-sequence used.
1.1 kristaps 108: .\" SUB-SECTION
109: .Ss Special Characters
110: Special character sequences begin with the escape character
1.16 kristaps 111: .Sq \e
1.4 kristaps 112: followed by either an open-parenthesis
1.1 kristaps 113: .Sq \&(
114: for two-character sequences; an open-bracket
115: .Sq \&[
116: for n-character sequences (terminated at a close-bracket
117: .Sq \&] ) ;
118: or a single one-character sequence.
119: .Pp
120: Characters may alternatively be escaped by a slash-asterisk,
1.16 kristaps 121: .Sq \e* ,
1.4 kristaps 122: with the same combinations as described above. This form is deprecated.
1.1 kristaps 123: .\" SECTION
1.17 kristaps 124: .Sh STRUCTURE
1.13 kristaps 125: Macros are classified in an ontology described by their scope rules.
126: Some macros are allowed to deviate from their classifications to
127: preserve backward-compatibility with old macro combinations still found
128: in the manual corpus. These are specifically noted on a per-macro
129: basis.
1.4 kristaps 130: .\" SUB-SECTION
131: .Ss Scope
1.2 kristaps 132: .Bl -inset
1.1 kristaps 133: .\" LIST-ITEM
134: .It Em Block
1.2 kristaps 135: macros enclose other block macros, in-line macros or text, and
1.4 kristaps 136: may span multiple lines.
1.2 kristaps 137: .Bl -inset -offset XXXX
1.1 kristaps 138: .\" LIST-ITEM
139: .It Em Full-block
1.5 kristaps 140: macros always span multiple lines. They consist of zero or
1.2 kristaps 141: more
1.1 kristaps 142: .Qq heads ,
1.5 kristaps 143: subsequent macros or text on the same line following invocation; an
144: optional
1.1 kristaps 145: .Qq body ,
146: which spans subsequent lines of text or macros; and an optional
147: .Qq tail ,
148: macros or text on the same line following closure.
149: .\" LIST-ITEM
150: .It Em Partial-block
1.5 kristaps 151: macros may span multiple lines. They consists of a optional
1.1 kristaps 152: .Qq head ,
153: text immediately following invocation; always a
154: .Qq body ,
155: text or macros following the head on the same and subsequent lines; and
156: optionally a
157: .Qq tail ,
158: text immediately following closure.
159: .\" LIST-ITEM
160: .It Em In-line
1.4 kristaps 161: macros may only enclose text and span at most a single line.
162: .El
163: .El
164: .\" SUB-SECTION
165: .Ss Closure
166: Closure of a macro's scope depends first on its classification, then
167: on whether it's parsable. In this table,
168: .Sq BFE
169: refers to block full-explicit and so on.
170: .\" PARAGRAPH
171: .Pp
172: .Bl -tag -width 12n -offset XXXX -compact
173: .It BPE , BFE
174: corresponding explicit closure macro
175: .It BFI
176: end-of-file or a corresponding implicit closure macro
177: .It BPI
178: end-of-line (body may be closed by >0 space-separated
179: .Sx Reserved Characters ,
180: although block scope will still be open)
181: .It INL
182: end-of-line
1.1 kristaps 183: .El
1.4 kristaps 184: .\" PARAGRAPH
185: .Pp
186: If a macro (block or in-line) is parsable, it may also be closed out by
187: one of the following scenarios (unless specifically noted otherwise):
188: .\" PARAGRAPH
189: .Pp
190: .Bl -dash -offset XXXX -compact
191: .It
192: a sequence of >0 space-separated
193: .Sx Reserved Characters ,
194: .It
195: another macro,
196: .It
197: end-of-line, or
198: .It
199: completion of a set number of arguments.
200: .El
201: .\" PARAGRAPH
202: .Pp
203: If >0 space-separated
204: .Sx Reserved Characters
205: are followed by non-reserved characters, the behaviour differs per
206: macro. In general, scope of the macro is closed and re-opened:
207: subsequent tokens are interpreted as if the scope had just been opened.
208: In other circumstances, scope is simply closed out.
1.1 kristaps 209: .\" SECTION
1.2 kristaps 210: .Sh SYNTAX
1.17 kristaps 211: Macros are two or three characters in length. The syntax of macro
212: invocation depends on its classification.
1.2 kristaps 213: .Qq \-arg
214: refers to the macro arguments (which may contain zero or more values).
215: In these illustrations,
216: .Sq \&.Yo
217: opens the scope of a macro, and if specified,
218: .Sq \&.Yc
219: closes it out (closure may be implicit at end-of-line or end-of-file).
1.4 kristaps 220: .\" PARAGRAPH
1.2 kristaps 221: .Pp
1.4 kristaps 222: Block full-explicit (may contain head, body, tail).
1.2 kristaps 223: .Bd -literal -offset XXXX
1.4 kristaps 224: \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBhead...\(rB
225: \(lBbody...\(rB
226: \&.Yc \(lBtail...\(rB
1.2 kristaps 227: .Ed
1.4 kristaps 228: .\" PARAGRAPH
1.2 kristaps 229: .Pp
1.4 kristaps 230: Block full-implicit (may contain zero or more heads, body, no tail).
1.2 kristaps 231: .Bd -literal -offset XXXX
1.4 kristaps 232: \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBhead... \(lBTa head...\(rB\(rB
233: \(lBbody...\(rB
1.2 kristaps 234: \&.Yc
235: .Ed
1.4 kristaps 236: .\" PARAGRAPH
1.2 kristaps 237: .Pp
1.4 kristaps 238: Block partial-explicit (may contain head, multi-line body, tail).
1.2 kristaps 239: .Bd -literal -offset XXXX
240: \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBhead...\(rB
1.4 kristaps 241: \(lBbody...\(rB
242: \&.Yc \(lBtail...\(rB
1.2 kristaps 243:
244: \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBhead...\(rB \
1.4 kristaps 245: \(lBbody...\(rB \&Yc \(lBtail...\(rB
1.2 kristaps 246: .Ed
1.4 kristaps 247: .\" PARAGRAPH
1.2 kristaps 248: .Pp
1.4 kristaps 249: Block partial-implicit (no head, body, no tail). Note that the body
250: section may be followed by zero or more
251: .Sx Reserved Words .
252: These are in the block scope, but not in the body scope.
1.2 kristaps 253: .Bd -literal -offset XXXX
1.4 kristaps 254: \&.Yo \(lB\-arg \(lBval...\(rB\(rB \(lBbody...\(rB \(lBreserved...\(rB
1.2 kristaps 255: .Ed
1.4 kristaps 256: .\" PARAGRAPH
1.2 kristaps 257: .Pp
1.4 kristaps 258: In-lines have \(>=0 scoped arguments.
1.2 kristaps 259: .Bd -literal -offset XXX
1.4 kristaps 260: \&.Yy \(lB\-arg \(lBval...\(rB\(rB \(lBargs...\(rB
1.2 kristaps 261:
262: \&.Yy \(lB\-arg \(lBval...\(rB\(rB arg0 arg1 argN
263: .Ed
264: .\"
1.1 kristaps 265: .Sh MACROS
266: This section contains a complete list of all
267: .Nm
1.2 kristaps 268: macros, arranged ontologically. A
1.1 kristaps 269: .Qq callable
1.17 kristaps 270: macro is invoked subsequent to the initial macro-line macro. A
1.1 kristaps 271: .Qq parsable
1.2 kristaps 272: macro may be followed by further (ostensibly callable) macros.
1.1 kristaps 273: .\" SUB-SECTION
274: .Ss Block full-implicit
275: The head of these macros follows invocation; the body is the content of
276: subsequent lines prior to closure. None of these macros have tails;
277: some
278: .Po
1.16 kristaps 279: .Sq \&.It \-bullet ,
1.1 kristaps 280: .Sq \-hyphen ,
281: .Sq \-dash ,
1.2 kristaps 282: .Sq \-enum ,
283: .Sq \-item
1.1 kristaps 284: .Pc
285: don't have heads.
286: .Pp
287: .Bl -column "MacroX" "CallableX" "ParsableX" "Closing" -compact -offset XXXX
288: .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Closing
289: .It \&.Sh Ta \&No Ta \&No Ta \&.Sh
290: .It \&.Ss Ta \&No Ta \&No Ta \&.Sh, \&.Ss
291: .It \&.It Ta \&No Ta Yes Ta \&.It, \&.El
292: .El
293: .\" SUB-SECTION
294: .Ss Block full-explicit
295: None of these macros are callable or parsed. The last column indicates
296: the explicit scope rules. All contains bodies, some may contain heads
297: .Pq So \&Bf Sc .
298: .Pp
299: .Bl -column "MacroX" "CallableX" "ParsableX" "closed by XXX" -compact -offset XXXX
300: .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
301: .It \&.Bd Ta \&No Ta \&No Ta closed by \&.Ed
302: .It \&.Ed Ta \&No Ta \&No Ta opened by \&.Bd
303: .It \&.Bl Ta \&No Ta \&No Ta closed by \&.El
304: .It \&.El Ta \&No Ta \&No Ta opened by \&.Bl
305: .It \&.Bf Ta \&No Ta \&No Ta closed by \&.Ef
306: .It \&.Ef Ta \&No Ta \&No Ta opened by \&.Bf
1.2 kristaps 307: .It \&.Bk Ta \&No Ta \&No Ta closed by \&.Ek
308: .It \&.Ek Ta \&No Ta \&No Ta opened by \&.Bk
1.1 kristaps 309: .El
310: .\" SUB-SECTION
311: .Ss Block partial-implicit
312: All of these are callable and parsed for further macros. Their scopes
313: close at the invocation's end-of-line.
314: .Pp
315: .Bl -column "MacroX" "CallableX" "ParsableX" -compact -offset XXXX
316: .It Em Macro Ta Em Callable Ta Em Parsable
317: .It \&.Aq Ta Yes Ta Yes
318: .It \&.Op Ta Yes Ta Yes
319: .It \&.Bq Ta Yes Ta Yes
320: .It \&.Dq Ta Yes Ta Yes
321: .It \&.Pq Ta Yes Ta Yes
322: .It \&.Qq Ta Yes Ta Yes
323: .It \&.Sq Ta Yes Ta Yes
324: .It \&.Brq Ta Yes Ta Yes
1.2 kristaps 325: .It \&.D1 Ta \&No Ta \&Yes
326: .It \&.Dl Ta \&No Ta Yes
327: .It \&.Ql Ta Yes Ta Yes
1.1 kristaps 328: .El
1.13 kristaps 329: .\" PARAGRAPH
330: .Pp
331: The
1.16 kristaps 332: .Sq \&.Op
333: may be broken by
334: .Sq \&.Oc
335: as in the following example:
1.13 kristaps 336: .Bd -literal -offset XXXX
337: \&.Oo
338: \&.Op Fl a Oc
339: .Ed
340: .Pp
341: In the above example, the scope of
1.16 kristaps 342: .Sq \&.Op
1.13 kristaps 343: is technically broken by
1.16 kristaps 344: .Sq \&.Oc ,
1.13 kristaps 345: however, due to the overwhelming existence of this sequence, it's
346: allowed.
1.1 kristaps 347: .\" SUB-SECTION
348: .Ss Block partial-explicit
349: Each of these contains at least a body and, in limited circumstances, a
350: head
1.16 kristaps 351: .Pq So \&.Fo Sc , So \&.Eo Sc
1.1 kristaps 352: and/or tail
1.16 kristaps 353: .Pq So \&.Ec Sc .
1.1 kristaps 354: .Pp
355: .Bl -column "MacroX" "CallableX" "ParsableX" "closed by XXXX" -compact -offset XXXX
356: .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Scope
357: .It \&.Ao Ta Yes Ta Yes Ta closed by \&.Ac
358: .It \&.Ac Ta Yes Ta Yes Ta opened by \&.Ao
359: .It \&.Bc Ta Yes Ta Yes Ta closed by \&.Bo
360: .It \&.Bo Ta Yes Ta Yes Ta opened by \&.Bc
361: .It \&.Pc Ta Yes Ta Yes Ta closed by \&.Po
362: .It \&.Po Ta Yes Ta Yes Ta opened by \&.Pc
363: .It \&.Do Ta Yes Ta Yes Ta closed by \&.Dc
364: .It \&.Dc Ta Yes Ta Yes Ta opened by \&.Do
365: .It \&.Xo Ta Yes Ta Yes Ta closed by \&.Xc
366: .It \&.Xc Ta Yes Ta Yes Ta opened by \&.Xo
367: .It \&.Bro Ta Yes Ta Yes Ta closed by \&.Brc
368: .It \&.Brc Ta Yes Ta Yes Ta opened by \&.Bro
369: .It \&.Oc Ta Yes Ta Yes Ta closed by \&.Oo
370: .It \&.Oo Ta Yes Ta Yes Ta opened by \&.Oc
371: .It \&.So Ta Yes Ta Yes Ta closed by \&.Sc
372: .It \&.Sc Ta Yes Ta Yes Ta opened by \&.So
373: .It \&.Fc Ta Yes Ta Yes Ta opened by \&.Fo
374: .It \&.Fo Ta \&No Ta \&No Ta closed by \&.Fc
375: .It \&.Ec Ta Yes Ta Yes Ta opened by \&.Eo
376: .It \&.Eo Ta Yes Ta Yes Ta closed by \&.Ec
377: .It \&.Qc Ta Yes Ta Yes Ta opened by \&.Oo
378: .It \&.Qo Ta Yes Ta Yes Ta closed by \&.Oc
1.2 kristaps 379: .It \&.Re Ta \&No Ta \&No Ta opened by \&.Rs
380: .It \&.Rs Ta \&No Ta \&No Ta closed by \&.Re
1.1 kristaps 381: .El
382: .\" SUB-SECTION
1.2 kristaps 383: .Ss In-line
1.3 kristaps 384: In-line macros have only text children. If a number (or inequality) of
385: arguments is
386: .Pq n ,
387: then the macro accepts an arbitrary number of arguments.
1.2 kristaps 388: .Pp
389: .Bl -column "MacroX" "CallableX" "ParsableX" "Arguments" -compact -offset XXXX
390: .It Em Macro Ta Em Callable Ta Em Parsable Ta Em Arguments
1.3 kristaps 391: .It \&.Dd Ta \&No Ta \&No Ta >0
392: .It \&.Dt Ta \&No Ta \&No Ta n
393: .It \&.Os Ta \&No Ta \&No Ta n
1.2 kristaps 394: .It \&.Pp Ta \&No Ta \&No Ta 0
1.3 kristaps 395: .It \&.Ad Ta Yes Ta Yes Ta n
396: .It \&.An Ta \&No Ta Yes Ta n
397: .It \&.Ar Ta Yes Ta Yes Ta n
398: .It \&.Cd Ta Yes Ta \&No Ta >0
399: .It \&.Cm Ta Yes Ta Yes Ta n
1.11 kristaps 400: .It \&.Dv Ta Yes Ta Yes Ta n
1.3 kristaps 401: .It \&.Er Ta Yes Ta Yes Ta >0
1.11 kristaps 402: .It \&.Ev Ta Yes Ta Yes Ta n
1.3 kristaps 403: .It \&.Ex Ta \&No Ta \&No Ta 0
1.12 kristaps 404: .It \&.Fa Ta Yes Ta Yes Ta n
1.3 kristaps 405: .It \&.Fd Ta \&No Ta \&No Ta >0
406: .It \&.Fl Ta Yes Ta Yes Ta n
407: .It \&.Fn Ta Yes Ta Yes Ta >0
408: .It \&.Ft Ta \&No Ta Yes Ta n
409: .It \&.Ic Ta Yes Ta Yes Ta >0
410: .It \&.In Ta \&No Ta \&No Ta n
1.11 kristaps 411: .It \&.Li Ta Yes Ta Yes Ta n
1.3 kristaps 412: .It \&.Nd Ta \&No Ta \&No Ta n
413: .It \&.Nm Ta Yes Ta Yes Ta n
414: .It \&.Ot Ta \&No Ta \&No Ta n
415: .It \&.Pa Ta Yes Ta Yes Ta n
416: .It \&.Rv Ta \&No Ta \&No Ta 0
417: .It \&.St Ta \&No Ta Yes Ta 1
1.11 kristaps 418: .It \&.Va Ta Yes Ta Yes Ta n
1.3 kristaps 419: .It \&.Vt Ta Yes Ta Yes Ta >0
420: .It \&.Xr Ta Yes Ta Yes Ta >0, <3
421: .It \&.%A Ta \&No Ta \&No Ta >0
422: .It \&.%B Ta \&No Ta \&No Ta >0
423: .It \&.%C Ta \&No Ta \&No Ta >0
424: .It \&.%D Ta \&No Ta \&No Ta >0
425: .It \&.%I Ta \&No Ta \&No Ta >0
426: .It \&.%J Ta \&No Ta \&No Ta >0
427: .It \&.%N Ta \&No Ta \&No Ta >0
428: .It \&.%O Ta \&No Ta \&No Ta >0
429: .It \&.%P Ta \&No Ta \&No Ta >0
430: .It \&.%R Ta \&No Ta \&No Ta >0
431: .It \&.%T Ta \&No Ta \&No Ta >0
432: .It \&.%V Ta \&No Ta \&No Ta >0
433: .It \&.At Ta Yes Ta Yes Ta 1
434: .It \&.Bsx Ta Yes Ta Yes Ta n
435: .It \&.Bx Ta Yes Ta Yes Ta n
436: .It \&.Db Ta \&No Ta \&No Ta 1
1.19 kristaps 437: .It \&.Em Ta Yes Ta Yes Ta >0
1.3 kristaps 438: .It \&.Fx Ta Yes Ta Yes Ta n
439: .It \&.Ms Ta \&No Ta Yes Ta >0
440: .It \&.No Ta Yes Ta Yes Ta 0
441: .It \&.Ns Ta Yes Ta Yes Ta 0
442: .It \&.Nx Ta Yes Ta Yes Ta n
443: .It \&.Ox Ta Yes Ta Yes Ta n
444: .It \&.Pf Ta \&No Ta Yes Ta 1
445: .It \&.Sm Ta \&No Ta \&No Ta 1
446: .It \&.Sx Ta Yes Ta Yes Ta >0
447: .It \&.Sy Ta Yes Ta Yes Ta >0
448: .It \&.Tn Ta Yes Ta Yes Ta >0
449: .It \&.Ux Ta Yes Ta Yes Ta n
1.6 kristaps 450: .It \&.Dx Ta Yes Ta Yes Ta n
1.3 kristaps 451: .It \&.Bt Ta \&No Ta \&No Ta 0
452: .It \&.Hf Ta \&No Ta \&No Ta n
453: .It \&.Fr Ta \&No Ta \&No Ta n
454: .It \&.Ud Ta \&No Ta \&No Ta 0
455: .It \&.Lb Ta \&No Ta \&No Ta 1
456: .It \&.Ap Ta Yes Ta Yes Ta 0
457: .It \&.Lp Ta \&No Ta \&No Ta 0
458: .It \&.Lk Ta \&No Ta Yes Ta >0
459: .It \&.Mt Ta \&No Ta Yes Ta >0
1.6 kristaps 460: .It \&.Es Ta \&No Ta \&No Ta 0
461: .It \&.En Ta \&No Ta \&No Ta 0
1.1 kristaps 462: .El
1.6 kristaps 463: .Pp
464: The
1.16 kristaps 465: .Sq \&.Ot ,
466: .Sq \&.Fr ,
467: .Sq \&.Es
1.6 kristaps 468: and
1.16 kristaps 469: .Sq \&.En ,
1.6 kristaps 470: macros are obsolete.
1.2 kristaps 471: .\" SECTION
1.4 kristaps 472: .Sh COMPATIBILITY
473: The mdoc language was traditionally a
474: .Qq roff
475: macro package; most existing manuals were written with mdoc syntax
476: dictated by system-dependent roff installations. This section documents
477: compatibility with these systems.
478: .Pp
479: .Bl -dash -compact
480: .\" LIST-ITEM
481: .It
1.16 kristaps 482: .Sq \&.Fo
1.5 kristaps 483: and
1.16 kristaps 484: .Sq \&.St
1.5 kristaps 485: historically weren't always callable. Both are now correctly callable.
486: .\" LIST-ITEM
487: .It
1.16 kristaps 488: .Sq \&.It \-nested
1.4 kristaps 489: is assumed for all lists: any list may be nested and
490: .Sq \-enum
491: lists will restart the sequence only for the sub-list.
492: .\" LIST-ITEM
493: .It
1.16 kristaps 494: .Sq \&.It \-column
1.21 kristaps 495: syntax where column widths may be preceded by other arguments (instead
1.4 kristaps 496: of proceeded) is not supported.
497: .\" LIST-ITEM
498: .It
499: The
1.16 kristaps 500: .Sq \&.At
1.4 kristaps 501: macro only accepts a single parameter.
502: .\" LIST-ITEM
503: .It
504: The system-name macros (
1.16 kristaps 505: .Ns Sq \&.At ,
506: .Sq \&.Bsx ,
507: .Sq \&.Bx ,
508: .Sq \&.Fx ,
509: .Sq \&.Nx ,
510: .Sq \&.Ox ,
1.4 kristaps 511: and
1.16 kristaps 512: .Sq \&.Ux )
1.4 kristaps 513: are callable.
514: .\" LIST-ITEM
515: .It
516: Some manuals use
1.16 kristaps 517: .Sq \&.Li
1.4 kristaps 518: incorrectly by following it with a reserved character and expecting the
519: delimiter to render. This is not supported.
520: .\" LIST-ITEM
521: .It
1.16 kristaps 522: .Sq \&.Cd
1.4 kristaps 523: is callable.
524: .El
525: .\" SECTION
1.2 kristaps 526: .Sh SEE ALSO
1.19 kristaps 527: .Xr mandoc 1 ,
528: .Xr mandoc_char 7
1.2 kristaps 529: .\" SECTION
530: .Sh AUTHORS
531: The
532: .Nm
533: utility was written by
1.24 ! kristaps 534: .An Kristaps Dzonsons Aq kristaps@kth.se .
1.5 kristaps 535: .\" SECTION
536: .Sh CAVEATS
537: There are several ambiguous parts of mdoc.
538: .Pp
539: .Bl -dash -compact
540: .\" LIST-ITEM
541: .It
1.16 kristaps 542: .Sq \&.Fa
1.5 kristaps 543: should be
1.16 kristaps 544: .Sq \&.Va
1.5 kristaps 545: as function arguments are variables.
546: .\" LIST-ITEM
547: .It
1.16 kristaps 548: .Sq \&.Ft
1.5 kristaps 549: should be
1.16 kristaps 550: .Sq \&.Vt
1.5 kristaps 551: as function return types are still types. Furthermore, the
1.16 kristaps 552: .Sq \&.Ft
1.5 kristaps 553: should be removed and
1.16 kristaps 554: .Sq \&.Fo ,
1.5 kristaps 555: which ostensibly follows it, should follow the same convention as
1.16 kristaps 556: .Sq \&.Va .
1.5 kristaps 557: .\" LIST-ITEM
558: .It
1.16 kristaps 559: .Sq \&.Va
1.5 kristaps 560: should formalise that only one or two arguments are acceptable: a
1.21 kristaps 561: variable name and optional, preceding type.
1.5 kristaps 562: .\" LIST-ITEM
563: .It
1.16 kristaps 564: .Sq \&.Fd
1.5 kristaps 565: is ambiguous. It's commonly used to indicate an include file in the
566: synopsis section.
1.16 kristaps 567: .Sq \&.In
1.5 kristaps 568: should be used, instead.
569: .\" LIST-ITEM
570: .It
571: Only the
572: .Sq \-literal
573: argument to
1.16 kristaps 574: .Sq \&.Bd
1.5 kristaps 575: makes sense. The remaining ones should be removed.
576: .\" LIST-ITEM
577: .It
578: The
1.16 kristaps 579: .Sq \&.Xo
1.5 kristaps 580: and
1.16 kristaps 581: .Sq \&.Xc
1.5 kristaps 582: macros should be deprecated.
583: .\" LIST-ITEM
584: .It
585: The
1.16 kristaps 586: .Sq \&.Dt
1.5 kristaps 587: macro lacks clarity. It should be absolutely clear which title will
588: render when formatting the manual page.
1.6 kristaps 589: .\" LIST-ITEM
590: .It
591: A
1.16 kristaps 592: .Sq \&.Lx
1.6 kristaps 593: should be provided for Linux (\(`a la
1.16 kristaps 594: .Sq \&.Ox ,
595: .Sq \&.Nx
1.6 kristaps 596: etc.).
1.14 kristaps 597: .\" LIST-ITEM
598: .It
599: There's no way to refer to references in
1.16 kristaps 600: .Sq \&.Rs/.Re
1.14 kristaps 601: blocks.
1.5 kristaps 602: .El
CVSweb