=================================================================== RCS file: /cvs/mandoc/mdoc.7,v retrieving revision 1.243 retrieving revision 1.258 diff -u -p -r1.243 -r1.258 --- mandoc/mdoc.7 2014/11/28 18:09:01 1.243 +++ mandoc/mdoc.7 2016/10/11 17:30:33 1.258 @@ -1,4 +1,4 @@ -.\" $Id: mdoc.7,v 1.243 2014/11/28 18:09:01 schwarze Exp $ +.\" $Id: mdoc.7,v 1.258 2016/10/11 17:30:33 schwarze Exp $ .\" .\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons .\" Copyright (c) 2010, 2011, 2013 Ingo Schwarze @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: November 28 2014 $ +.Dd $Mdocdate: October 11 2016 $ .Dt MDOC 7 .Os .Sh NAME @@ -304,6 +304,11 @@ Print verbose information. \&.El .Ed .Pp +List the options in alphabetical order, +uppercase before lowercase for each letter and +with no regard to whether an option takes an argument. +Put digits in ascending order before all letter options. +.Pp Manuals not documenting a command won't include the above fragment. .Pp Since the @@ -433,7 +438,7 @@ in the alphabetical .Ss Document preamble and NAME section macros .Bl -column "Brq, Bro, Brc" description .It Sx \&Dd Ta document date: Cm $\&Mdocdate$ | Ar month day , year -.It Sx \&Dt Ta document title: Ar TITLE section Op Ar volume | arch +.It Sx \&Dt Ta document title: Ar TITLE section Op Ar arch .It Sx \&Os Ta operating system version: Op Ar system Op Ar version .It Sx \&Nm Ta document name (one argument) .It Sx \&Nd Ta document description (one line) @@ -454,6 +459,7 @@ in the alphabetical .Op Fl compact .It Sx \&D1 Ta indented display (one line) .It Sx \&Dl Ta indented literal display (one line) +.It Sx \&Ql Ta in-line literal display: Ql text .It Sx \&Bl , \&El Ta list block: .Fl Ar type .Op Fl width Ar val @@ -528,7 +534,6 @@ in the alphabetical .It Sx \&Dq , \&Do , \&Dc Ta enclose in typographic double quotes: Dq text .It Sx \&Qq , \&Qo , \&Qc Ta enclose in typewriter double quotes: Qq text .It Sx \&Sq , \&So , \&Sc Ta enclose in single quotes: Sq text -.It Sx \&Ql Ta single-quoted literal text: Ql text .It Sx \&Pq , \&Po , \&Pc Ta enclose in parentheses: Pq text .It Sx \&Bq , \&Bo , \&Bc Ta enclose in square brackets: Bq text .It Sx \&Brq , \&Bro , \&Brc Ta enclose in curly braces: Brq text @@ -777,7 +782,7 @@ The must be one of the following: .Bl -tag -width 13n -offset indent .It Fl centered -Produce one output line from each input line, and centre-justify each line. +Produce one output line from each input line, and center-justify each line. Using this display type is not recommended; many .Nm implementations render it poorly. @@ -822,7 +827,7 @@ which has no effect; .Cm right , which justifies to the right margin; or .Cm center , -which aligns around an imagined centre axis. +which aligns around an imagined center axis. .It A macro invocation, which selects a predefined width associated with that macro. @@ -1256,7 +1261,9 @@ Examples: .Dl \&.Dl % mandoc mdoc.7 \e(ba less .Pp See also +.Sx \&Ql , .Sx \&Bd +.Fl literal , and .Sx \&D1 . .Ss \&Do @@ -1299,7 +1306,7 @@ Its syntax is as follows: .Pf \. Sx \&Dt .Ar TITLE .Ar section -.Op Ar volume | arch +.Op Ar arch .Ed .Pp Its arguments are as follows: @@ -1314,69 +1321,28 @@ it should by convention be all caps. The manual section. This may be one of .Cm 1 -.Pq utilities , +.Pq General Commands , .Cm 2 -.Pq system calls , +.Pq System Calls , .Cm 3 -.Pq libraries , +.Pq Library Functions , .Cm 3p -.Pq Perl libraries , +.Pq Perl Library , .Cm 4 -.Pq devices , +.Pq Device Drivers , .Cm 5 -.Pq file formats , +.Pq File Formats , .Cm 6 -.Pq games , +.Pq Games , .Cm 7 -.Pq miscellaneous , +.Pq Miscellaneous Information , .Cm 8 -.Pq system utilities , -.Cm 9 -.Pq kernel functions , -.Cm X11 -.Pq X Window System , -.Cm X11R6 -.Pq X Window System , -.Cm unass -.Pq unassociated , -.Cm local -.Pq local system , -.Cm draft -.Pq draft manual , +.Pq System Manager's Manual , or -.Cm paper -.Pq paper . +.Cm 9 +.Pq Kernel Developer's Manual . It should correspond to the manual's filename suffix and defaults to the empty string if unspecified. -.It Ar volume -This overrides the volume inferred from -.Ar section . -This field is optional, and if specified, must be one of -.Cm USD -.Pq users' supplementary documents , -.Cm PS1 -.Pq programmers' supplementary documents , -.Cm AMD -.Pq administrators' supplementary documents , -.Cm SMM -.Pq system managers' manuals , -.Cm URM -.Pq users' reference manuals , -.Cm PRM -.Pq programmers' reference manuals , -.Cm KM -.Pq kernel manuals , -.Cm IND -.Pq master index , -.Cm MMI -.Pq master index , -.Cm LOCAL -.Pq local manuals , -.Cm LOC -.Pq local manuals , -or -.Cm CON -.Pq contributed manuals . .It Ar arch This specifies the machine architecture a manual page applies to, where relevant, for example @@ -1390,7 +1356,6 @@ The list of valid architectures varies by operating sy .Pp Examples: .Dl \&.Dt FOO 1 -.Dl \&.Dt FOO 4 KM .Dl \&.Dt FOO 9 i386 .Pp See also @@ -1662,7 +1627,7 @@ See also A function name. Its syntax is as follows: .Bd -ragged -offset indent -.Pf \. Ns Sx \&Fn +.Pf . Sx \&Fn .Op Ar functype .Ar funcname .Op Oo Ar argtype Oc Ar argname @@ -1798,17 +1763,18 @@ is preferred for displaying code; the .Sx \&Ic macro is used when referring to specific instructions. .Ss \&In -An -.Dq include -file. +The name of an include file. +This macro is most often used in section 2, 3, and 9 manual pages. +.Pp When invoked as the first macro on an input line in the .Em SYNOPSIS section, the argument is displayed in angle brackets and preceded by -.Dq #include , +.Qq #include , and a blank line is inserted in front if there is a preceding function declaration. -This is most often used in section 2, 3, and 9 manual pages. +In other sections, it only encloses its argument in angle brackets +and causes no line break. .Pp Examples: .Dl \&.In sys/types.h @@ -1969,11 +1935,9 @@ Examples: .Dl \&.An Kristaps Dzonsons \&Aq \&Mt kristaps@bsd.lv .Ss \&Nd A one line description of the manual's content. -This may only be invoked in the -.Em SYNOPSIS -section subsequent the -.Sx \&Nm -macro. +This is the mandatory last macro of the +.Em NAME +section and not appropriate for other sections. .Pp Examples: .Dl Pf . Sx \&Nd mdoc language reference @@ -2130,8 +2094,16 @@ Its syntax is as follows: The optional .Ar system parameter specifies the relevant operating system or environment. -Left unspecified, it defaults to the local operating system version. -This is the suggested form. +It is suggested to leave it unspecified, in which case +.Xr mandoc 1 +uses its +.Fl Ios +argument or, if that isn't specified either, +.Fa sysname +and +.Fa release +as returned by +.Xr uname 3 . .Pp Examples: .Dl \&.Os @@ -2188,19 +2160,23 @@ See also Close parenthesised context opened by .Sx \&Po . .Ss \&Pf -Removes the space between its argument -.Pq Dq prefix -and the following macro. +Removes the space between its argument and the following macro. Its syntax is as follows: .Pp .D1 .Pf Ar prefix macro arguments ... .Pp This is equivalent to: .Pp -.D1 .No Ar prefix No \&Ns Ar macro arguments ... +.D1 .No \e& Ns Ar prefix No \&Ns Ar macro arguments ... .Pp +The +.Ar prefix +argument is not parsed for macro names or delimiters, +but used verbatim as if it were escaped. +.Pp Examples: .Dl ".Pf $ Ar variable_name" +.Dl ".Pf . Ar macro_name" .Dl ".Pf 0x Ar hex_digits" .Pp See also @@ -2235,11 +2211,21 @@ See also Close quoted context opened by .Sx \&Qo . .Ss \&Ql -Format a single-quoted literal. +In-line literal display. +This can for example be used for complete command invocations and +for multi-word code fragments when more specific markup is not +appropriate and an indented display is not desired. +While +.Xr mandoc 1 +always encloses the arguments in single quotes, other formatters +usually omit the quotes on non-terminal output devices when the +arguments have three or more characters. +.Pp See also -.Sx \&Qq +.Sx \&Dl and -.Sx \&Sq . +.Sx \&Bd +.Fl literal . .Ss \&Qo Multi-line version of .Sx \&Qq . @@ -2290,7 +2276,7 @@ Examples: \&.%A J. D. Ullman \&.%B Introduction to Automata Theory, Languages, and Computation \&.%I Addison-Wesley -\&.%C Reading, Massachusettes +\&.%C Reading, Massachusetts \&.%D 1979 \&.Re .Ed @@ -2426,8 +2412,6 @@ The original C standard. .Pp .It \-isoC-99 .St -isoC-99 -.It \-ansiC-99 -.St -ansiC-99 .br The second major version of the C language standard. .Pp @@ -2527,9 +2511,6 @@ The following three refer to parts of it. .br Networking APIs, including sockets. .Pp -.It \-xpg4.3 -.St -xpg4.3 -.Pp .It \-svid4 .St -svid4 , .br @@ -2559,14 +2540,9 @@ The following refer to parts of it. .It \-xns5.2 .St -xns5.2 .El -.It Single UNIX Specification version 3 and related standards +.It Single UNIX Specification version 3 .Pp -.Bl -tag -width "-p1003.1g-2000X" -compact -.It \-p1003.1d-99 -.St -p1003.1d-99 -.br -Additional real-time extensions. -.Pp +.Bl -tag -width "-p1003.1-2001" -compact .It \-p1003.1-2001 .St -p1003.1-2001 .It \-susv3 @@ -3165,50 +3141,13 @@ Manually switching the font using the font escape sequences is never required. .Sh COMPATIBILITY This section provides an incomplete list of compatibility issues -between mandoc and other troff implementations, at this time limited -to GNU troff +between mandoc and GNU troff .Pq Qq groff . -The term -.Qq historic groff -refers to groff versions before 1.17, -which featured a significant update of the -.Pa doc.tmac -file. .Pp -Heirloom troff, the other significant troff implementation accepting -\-mdoc, is similar to historic groff. -.Pp The following problematic behaviour is found in groff: -.ds hist (Historic groff only.) .Pp .Bl -dash -compact .It -Display macros -.Po -.Sx \&Bd , -.Sx \&Dl , -and -.Sx \&D1 -.Pc -may not be nested. -\*[hist] -.It -.Sx \&At -with unknown arguments produces no output at all. -\*[hist] -Newer groff and mandoc print -.Qq AT&T UNIX -and the arguments. -.It -.Sx \&Bl Fl column -does not recognise trailing punctuation characters when they immediately -precede tabulator characters, but treats them as normal text and -outputs a space before them. -.It -.Sx \&Bd Fl ragged compact -does not start a new line. -\*[hist] -.It .Sx \&Dd with non-standard arguments behaves very strangely. When there are three arguments, they are printed verbatim. @@ -3217,53 +3156,6 @@ but without any arguments the string .Dq Epoch is printed. .It -.Sx \&Fl -does not print a dash for an empty argument. -\*[hist] -.It -.Sx \&Fn -does not start a new line unless invoked as the line macro in the -.Em SYNOPSIS -section. -\*[hist] -.It -.Sx \&Fo -with -.Pf non- Sx \&Fa -children causes inconsistent spacing between arguments. -In mandoc, a single space is always inserted between arguments. -.It -.Sx \&Ft -in the -.Em SYNOPSIS -causes inconsistent vertical spacing, depending on whether a prior -.Sx \&Fn -has been invoked. -See -.Sx \&Ft -and -.Sx \&Fn -for the normalised behaviour in mandoc. -.It -.Sx \&In -ignores additional arguments and is not treated specially in the -.Em SYNOPSIS . -\*[hist] -.It -.Sx \&It -sometimes requires a -.Fl nested -flag. -\*[hist] -In new groff and mandoc, any list may be nested by default and -.Fl enum -lists will restart the sequence only for the sub-list. -.It -.Sx \&Li -followed by a delimiter is incorrectly used in some manuals -instead of properly quoting that character, which sometimes works with -historic groff. -.It .Sx \&Lk only accepts a single link-name argument; the remainder is misformatted. .It @@ -3277,19 +3169,6 @@ can only be called by other macros, but not at the beg .Sx \&%C is not implemented (up to and including groff-1.22.2). .It -Historic groff only allows up to eight or nine arguments per macro input -line, depending on the exact situation. -Providing more arguments causes garbled output. -The number of arguments on one input line is not limited with mandoc. -.It -Historic groff has many un-callable macros. -Most of these (excluding some block-level macros) are callable -in new groff and mandoc. -.It -.Sq \(ba -(vertical bar) is not fully supported as a delimiter. -\*[hist] -.It .Sq \ef .Pq font face and @@ -3307,13 +3186,27 @@ The following features are unimplemented in mandoc: .Bl -dash -compact .It .Sx \&Bd -.Fl file Ar file . +.Fl file Ar file +is unsupported for security reasons. .It .Sx \&Bd +.Fl filled +does not adjust the right margin, but is an alias for +.Sx \&Bd +.Fl ragged . +.It +.Sx \&Bd +.Fl literal +does not use a literal font, but is an alias for +.Sx \&Bd +.Fl unfilled . +.It +.Sx \&Bd .Fl offset Cm center and -.Fl offset Cm right . -Groff does not implement centred and flush-right rendering either, +.Fl offset Cm right +don't work. +Groff does not implement centered and flush-right rendering either, but produces large indentations. .El .Sh SEE ALSO @@ -3324,6 +3217,12 @@ but produces large indentations. .Xr mandoc_char 7 , .Xr roff 7 , .Xr tbl 7 +.Pp +The web page +.Lk http://mdocml.bsd.lv/mdoc/ "extended documentation for the mdoc language" +provides a few tutorial-style pages for beginners, an extensive style +guide for advanced authors, and an alphabetic index helping to choose +the best macros for various kinds of content. .Sh HISTORY The .Nm