Clarify that manpage references use the .IR macro everywhere.
[mmh] / docs / README.manpages
1 NMH MANPAGE STYLE GUIDE
2
3 nmh manpages should be in this general form:
4
5 .TH COMP %manext1% "DATE" "%nmhversion%"
6 .\"
7 .\" %nmhwarning%
8 .\"
9 .SH NAME
10 comp \- compose a message
11 .SH SYNOPSIS
12 .B comp 
13 .RI [ +folder ]
14 .RI [ msgs ]
15 .RB [ \-form
16 .IR formfile ]
17 .RB [ \-use " | " \-nouse ]
18 .RB [ \-version ]
19 .RB [ \-help ]
20 .SH DESCRIPTION
21 .B Comp
22 is used to create a new message to be mailed.  It copies something.
23 .SH FILES
24 .TP
25 filename1
26 description of filename1
27 .TP
28 filename2
29 description of filename2
30 .SH "PROFILE COMPONENTS"
31 .TP
32 Path
33 Location of the user's MH folder directory
34 .TP
35 moreproc
36 The pager command name
37 .SH "SEE ALSO"
38 .IR dist (1),
39 .IR forw (1),
40 .IR repl (1),
41 .IR send (1),
42 .IR whatnow (1),
43 .IR mh-profile (5)
44 .SH DEFAULTS
45 .TP
46 .RI + folder
47 defaults to the current folder
48 .\"
49 .SH CONTEXT
50 None
51 .\" Leave out the BUGS section if there are none worth describing.
52 .SH BUGS
53 None
54
55 ---------------------------------------
56 The DATE in the .TH macro should reflect the most recent non-trivial
57 update to the content of the manpage; formatting changes don't count.
58 Spell out the date (no abbreviations or shortcuts):
59
60   January 2, 1904
61
62 not the unparseable
63
64   01/02/04
65
66 Don't abbreviate the month.
67
68
69 In the FILES section, prefer the default .TP indent. The pathnames are
70 variable and long, so any indentation value that works for you won't
71 work for someone else.
72
73
74 Source files
75
76         There should be no ".so" commands to source an external file,
77         since these break on Linux, where the man program does not
78         allow source files outside the man/ hierarchy. Instead, insert
79         this fragment:
80
81                 .PP
82                 .RS 5
83                 .nf
84                 %components%
85                 .fi
86                 .RE
87                 .PP
88
89         Of course, replace "components" with a unique identifier that
90         reflects the content being included, like "mts_conf" for
91         etc/mts.conf. Then, add two lines to the man.sed target in
92         Makefile.in like:
93
94                 echo '/%components%/r $(top_srcdir)/etc/components' >> $@
95                 echo ' s,%components%,,g' >> $@
96
97         At compile time, the contents of the file will physically
98         incorporated into the body of the man page. This is somewhat
99         unfortunate, since later modifications won't be reflected in
100         the manpage, but on the other hand, the manpage will show the
101         default configuration and not local modifications.
102
103 Program names
104
105         All nmh program names should be bolded. If there is punctuation
106         after the name, use a .BR construct to avoid the automatic
107         space that's inserted with just a .B:
108
109                 .B comp
110                 .BR comp ,
111
112         If this is a manpage reference, use:
113
114                 .IR mh-draft (5)
115
116 SYNPOSIS section
117
118         Literal text (such as flags) should be in bold. Parameters
119         should be italicized. Mutually exclusive options (like
120         "-foo" and "-nofoo") should be grouped together and seperated
121         by a "|":
122
123                 .RI [ +folder ]              <---- parameter
124                 .RI [ msgs ]                 <---- parameter
125                 .RB [ \-version ]            <---- flag
126                 .RB [ \-editor               <---- flag with
127                 .IR editor ]                       parameter
128                 .RB [ \-use " | " \-nouse ]  <---- exclusive parameters
129
130         References to these flags or parameters in the body text of the
131         manpage should reflect these conventions:
132
133                 You may not supply both a
134                 .B \-form
135                 .I formfile
136                 and a
137                 .I +folder
138                 or
139                 .I msg
140                 argument.
141
142         In particular, don't enclose them in single quotes (except
143         in the DEFAULT section, which might be inconsistent, but
144         seems a little clearer.
145
146         For "-flag param" situations, try to use a .B/.I combination
147         instead of a single .BI, since it allows more flexibility in
148         case of punctuation, and we get an automatic space between
149         flag and param for free, without having to manual force it.
150
151 Subsections
152
153         Use ".SS" to denote a subsection
154
155 Tables
156
157         The folder manpage has an example of a table.
158
159         .PP
160         .RS 5
161         .nf
162         .ta \w'/rnd/phyl/Mail/EP 'u +\w'has ddd messages 'u +\w'(ddd\-ddd); 'u
163         FOLDER  \0\0\0\0\0\0# MESSAGES  RANGE   CUR     (OTHERS)
164         ff      has \0no messages.
165         inbox+  has \016 messages       (\03\-\022);    cur=\05.
166         mh      has \076 messages       (15\-\076);     cur=70.
167         .fi
168         .RE
169         .PP
170
171 Other italicized text
172
173         Italicize file names, profile entries, and folder names:
174
175                 If a file named
176                 .RI \*(lq components \*(rq
177                 exists in the user's nmh directory,
178
179                 If the user's profile contains a
180                 .RI \*(lq "Msg\-Protect: nnn" \*(rq
181                 entry, it
182
183                 The \*(lq+\*(rq after
184                 .I inbox
185                 indicates that it is the current folder.
186
187         Enclose the file names and profile entries in lq/rq
188         quotes, too.
189
190 Pointer manpages
191
192         Certain manpages are shared between one or more programs
193         (such as folder/folders). The secondary program should
194         have a man page that only contains:
195
196                 .so man1/folder.1
197
198         Also, add this manpage to the appropriate section in Makefile.in
199         
200
201 CONTEXT
202     Don't include a CONTEXT section when contexts are out of context.
203
204
205 AUTHOR and HISTORY sections
206
207     These have no place in a manpage.  If you want everlasting glory,
208     try the release notes.
209
210 BUGS
211
212     The BUGS section goes last.