]> diplodocus.org Git - nmh/blob - docs/README.manpages
Alter mh-chart(7)'s NAME to be lowercase.
[nmh] / docs / README.manpages
1 NMH MANPAGE STYLE GUIDE
2 =======================
3
4 Nmh manpages generally follow the traditional Bell Labs formatting
5 conventions. We do adopt a few conventions from BSD (primarily,
6 section ordering), and have a few of our own (mostly related to
7 indentation).
8
9
10 Troff Considerations
11
12 Proper sentences end with a period followed by a newline:
13
14 This is a sentence.
15 It is followed by another, longer, sentence, but
16 which makes no more sense than the previous one.
17
18 not
19
20 This is a sentence. It is followed by another,
21 longer, sentence, but which makes no more sense
22 than the previous one.
23
24 This allows troff to set the correct inter-sentence spacing
25 based on the output device.
26
27 When quoting, use \*(lq and \*(rq. This ensures correct
28 formatting on typesetter-like devices.
29
30 Don't use UTF-8 characters in the manpage source. We still
31 build and run on systems that can't handle this. And most
32 anything you would want to use has an internal troff character
33 escape sequence, anyway.
34
35
36 Section Ordering
37
38 Always present sections in the following order:
39
40 NAME [*]
41 SYNOPSIS [*]
42 DESCRIPTION [*]
43 PROFILE COMPONENTS
44 DEFAULTS
45 CONTEXT
46 ENVIRONMENT
47 FILES
48 EXAMPLES
49 DIAGNOSTICS [*]
50 SEE ALSO
51 HISTORY
52 BUGS
53
54 Sections marked with a [*] are mandatory. Only include
55 the others if they are specifically applicable.
56
57 DIAGNOSTICS must document any non-zero exit codes, and can
58 provide context to error messages. Obviously it only applies
59 to section 1 and 8 manpages.
60
61
62 Dates
63
64 The DATE in the .TH macro should reflect the most recent
65 *non-trivial* update to the *content* of the manpage;
66 formatting changes don't count, nor does expanding the `SEE
67 ALSO' list. The date is in `yyyy-mm-dd' format.
68
69
70 Program Names
71
72 In running text, nmh program names should be set in bold,
73 unless you are explicitly referring to the command's
74 documentation, in which case use manpage cross-reference
75 style.
76
77 .B comp
78 .BR comp ,
79 .IR comp (1).
80
81 Be careful when referring to programs that are not part of
82 nmh itself. For commands that are almost guaranteed to be
83 part of the base OS, use a manpage cross-reference (e.g.
84 ".IR cat (1)"). For other third-party utilities, it might
85 be best to set the command name in double quotes. Use your
86 best judgement to make it clear when you're referring to
87 tools that might not be present.
88
89
90 SYNPOSIS Section
91
92 Set literal text (such as flags) in bold. Set parameters
93 in italic. Mutually exclusive options (like "-foo" and
94 "-nofoo") should be grouped together and separated by a
95 "|":
96
97 .RI [ +folder ] <---- parameter
98 .RI [ msgs ] <---- parameter
99 .RB [ \-version ] <---- flag
100 .RB [ \-editor <---- flag with
101 .IR editor ] parameter
102 .RB [ \-use " | " \-nouse ] <---- exclusive parameters
103
104 References to these flags or parameters in the body text of the
105 manpage should reflect these conventions:
106
107 You may not supply both a
108 .B \-form
109 .I formfile
110 and a
111 .I +folder
112 or
113 .I msg
114 argument.
115
116 In particular, don't enclose them in single quotes.
117
118 For "-flag param" situations, try to use a .B/.I combination
119 instead of a single .BI, since it allows more flexibility in
120 case of punctuation, and we get an automatic space between
121 flag and param for free, without having to manual force it.
122
123
124 Subsections
125
126 Use ".SS" to denote a subsection
127
128
129 Tables
130
131 The folder manpage has an example of a table.
132
133 .PP
134 .RS 5
135 .nf
136 .ta \w'/rnd/phyl/Mail/EP 'u +\w'has ddd messages 'u +\w'(ddd\-ddd); 'u
137 FOLDER \0\0\0\0\0\0# MESSAGES RANGE CUR (OTHERS)
138 ff has \0no messages.
139 inbox+ has \016 messages (\03\-\022); cur=\05.
140 mh has \076 messages (15\-\076); cur=70.
141 .fi
142 .RE
143 .PP
144
145
146 Environment Variables
147
148 These are always set in roman text. The surrounding text
149 should make clear you are referring to an environment
150 variable. In some cases, like when dealing with all-lower-case
151 variable names, setting the name inside double quotes can
152 help clarify the context.
153
154 Never prepend a '$' character to an environment variable
155 name, unless you are directly referring to a variable
156 substitution in, say, a pathname.
157
158
159 Other Italicized Text
160
161 Italicize file names, profile entries, and folder names:
162
163 If a file named
164 .RI \*(lq components \*(rq
165 exists in the user's nmh directory,
166
167 If the user's profile contains a
168 .RI \*(lq "Msg\-Protect: nnn" \*(rq
169 entry, it
170
171 The \*(lq+\*(rq after
172 .I inbox
173 indicates that it is the current folder.
174
175 Enclose the file names and profile entries in lq/rq
176 quotes, too.
177
178
179 Relative Indentation
180
181 Use .RS 5 / .RE to indent paragraphs, etc. '.IP 5' can
182 be useful, too. Try to use an offset of '5' as much as
183 possible to maintain visual consistency.
184
185
186 Tagged Lists
187
188 In PROFILE COMPONENTS, DEFAULTS, ENVIRONMENT, and FILES,
189 use tagged paragraphs with an offset of 20. Do not set
190 the tag in bold or italic, or wrap it in quotes, unless
191 this is absolutely necessary to make the context clear.
192
193 .SH DEFAULTS
194 .PD 0
195 .TP 20
196 +folder
197 defaults to the current folder
198 .TP
199 msgs
200 defaults to
201 .I cur
202 .TP
203 -decodetext 8bit
204 .TP
205 -decodetypes text,application/ics
206 .TP
207 -crlflinebreaks
208 .PD
209 .SH [...]
210
211 Source Files
212
213 There should be no ".so" commands to source an external file,
214 since these break on Linux, where the man program does not
215 allow source files outside the man/ hierarchy. Instead, insert
216 this fragment:
217
218 .PP
219 .RS 5
220 .nf
221 %components%
222 .fi
223 .RE
224 .PP
225
226 Of course, replace "components" with a unique identifier that
227 reflects the content being included, like "mts_conf" for
228 etc/mts.conf. Then, add two lines to the man.sed target in
229 Makefile.in like:
230
231 echo '/%components%/r $(top_srcdir)/etc/components' >> $@
232 echo ' s,%components%,,g' >> $@
233
234 At compile time, the contents of the file will physically
235 incorporated into the body of the man page. This is somewhat
236 unfortunate, since later modifications won't be reflected in
237 the manpage, but on the other hand, the manpage will show the
238 default configuration and not local modifications.
239
240
241 Pointer Manpages
242
243 Certain manpages are shared between one or more programs
244 (such as folder/folders). The secondary program should
245 have a man page that only contains:
246
247 .so man1/folder.1
248
249 Also, add this manpage to the appropriate section in Makefile.in
250
251 AUTHOR and HISTORY Sections
252
253 These have no place in a manpage. If you want everlasting
254 glory, try the release notes. But note that a HISTORY
255 section might be appropriate for documenting incompatibility
256 with older versions of MH.
257
258 ------------------------------------------------------------------------------
259
260 [ This template is a bit behind the times. I will bring it into
261 conformance with the notes above once the notes settle down.
262 --lyndon ]
263
264
265 .TH COMP %manext1% "DATE" "%nmhversion%"
266 .\"
267 .\" %nmhwarning%
268 .\"
269 .SH NAME
270 comp \- compose a message
271 .\"
272 .SH SYNOPSIS
273 .HP 5
274 .na
275 .B comp
276 .RI [ +folder ]
277 .RI [ msgs ]
278 .RB [ \-form
279 .IR formfile ]
280 .RB [ \-use " | " \-nouse ]
281 .RB [ \-version ]
282 .RB [ \-help ]
283 .ad
284 .SH DESCRIPTION
285 .B Comp
286 is used to create a new message to be mailed.
287 It copies something.
288 .\"
289 .SH "PROFILE COMPONENTS"
290 .TP 20
291 Path
292 Location of the user's MH folder directory
293 .TP
294 moreproc
295 The pager command name
296 .\"
297 .SH DEFAULTS
298 .TP 20
299 .RI + folder
300 defaults to the current folder
301 .\"
302 .SH CONTEXT
303 None
304 .\"
305 .SH FILES
306 .TP 20
307 filename1
308 description of filename1
309 .TP
310 filename2
311 description of filename2
312 .\"
313 .SH "SEE ALSO"
314 .BR dist (1),
315 .BR forw (1),
316 .BR repl (1),
317 .BR send (1),
318 .BR whatnow (1),
319 .BR mh-profile (5)
320 .\" Leave out the BUGS section if there are none worth describing.
321 .SH BUGS
322 None
323