]> diplodocus.org Git - nmh/blob - docs/README.manpages
Added mhshow-suffix-text entry.
[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. Spell out the date (no
67 abbreviations or shortcuts):
68
69 January 2, 1904
70
71 not the unparseable
72
73 01/02/04
74
75 Don't abbreviate the month.
76
77
78 Program Names
79
80 In running text, nmh program names should be set in bold,
81 unless you are explicitly referring to the command's
82 documentation, in which case use manpage cross-reference
83 style.
84
85 .B comp
86 .BR comp ,
87 .IR comp (1).
88
89 Be careful when referring to programs that are not part of
90 nmh itself. For commands that are almost guaranteed to be
91 part of the base OS, use a manpage cross-reference (e.g.
92 ".IR cat (1)"). For other third-party utilities, it might
93 be best to set the command name in double quotes. Use your
94 best judgement to make it clear when you're referring to
95 tools that might not be present.
96
97
98 SYNPOSIS Section
99
100 Set literal text (such as flags) in bold. Set parameters
101 in italic. Mutually exclusive options (like "-foo" and
102 "-nofoo") should be grouped together and separated by a
103 "|":
104
105 .RI [ +folder ] <---- parameter
106 .RI [ msgs ] <---- parameter
107 .RB [ \-version ] <---- flag
108 .RB [ \-editor <---- flag with
109 .IR editor ] parameter
110 .RB [ \-use " | " \-nouse ] <---- exclusive parameters
111
112 References to these flags or parameters in the body text of the
113 manpage should reflect these conventions:
114
115 You may not supply both a
116 .B \-form
117 .I formfile
118 and a
119 .I +folder
120 or
121 .I msg
122 argument.
123
124 In particular, don't enclose them in single quotes.
125
126 For "-flag param" situations, try to use a .B/.I combination
127 instead of a single .BI, since it allows more flexibility in
128 case of punctuation, and we get an automatic space between
129 flag and param for free, without having to manual force it.
130
131
132 Subsections
133
134 Use ".SS" to denote a subsection
135
136
137 Tables
138
139 The folder manpage has an example of a table.
140
141 .PP
142 .RS 5
143 .nf
144 .ta \w'/rnd/phyl/Mail/EP 'u +\w'has ddd messages 'u +\w'(ddd\-ddd); 'u
145 FOLDER \0\0\0\0\0\0# MESSAGES RANGE CUR (OTHERS)
146 ff has \0no messages.
147 inbox+ has \016 messages (\03\-\022); cur=\05.
148 mh has \076 messages (15\-\076); cur=70.
149 .fi
150 .RE
151 .PP
152
153
154 Environment Variables
155
156 These are always set in roman text. The surrounding text
157 should make clear you are referring to an environment
158 variable. In some cases, like when dealing with all-lower-case
159 variable names, setting the name inside double quotes can
160 help clarify the context.
161
162 Never prepend a '$' character to an environment variable
163 name, unless you are directly referring to a variable
164 substitution in, say, a pathname.
165
166
167 Other Italicized Text
168
169 Italicize file names, profile entries, and folder names:
170
171 If a file named
172 .RI \*(lq components \*(rq
173 exists in the user's nmh directory,
174
175 If the user's profile contains a
176 .RI \*(lq "Msg\-Protect: nnn" \*(rq
177 entry, it
178
179 The \*(lq+\*(rq after
180 .I inbox
181 indicates that it is the current folder.
182
183 Enclose the file names and profile entries in lq/rq
184 quotes, too.
185
186
187 Relative Indentation
188
189 Use .RS 5 / .RE to indent paragraphs, etc. '.IP 5' can
190 be useful, too. Try to use an offset of '5' as much as
191 possible to maintain visual consistency.
192
193
194 Tagged Lists
195
196 In PROFILE COMPONENTS, DEFAULTS, ENVIRONMENT, and FILES,
197 use tagged paragraphs with an offset of 20. Do not set
198 the tag in bold or italic, or wrap it in quotes, unless
199 this is absolutely necessary to make the context clear.
200
201 .SH DEFAULTS
202 .PD 0
203 .TP 20
204 +folder
205 defaults to the current folder
206 .TP
207 msgs
208 defaults to
209 .I cur
210 .TP
211 -decodetext 8bit
212 .TP
213 -decodetypes text,application/ics
214 .TP
215 -crlflinebreaks
216 .PD
217 .SH [...]
218
219 Source Files
220
221 There should be no ".so" commands to source an external file,
222 since these break on Linux, where the man program does not
223 allow source files outside the man/ hierarchy. Instead, insert
224 this fragment:
225
226 .PP
227 .RS 5
228 .nf
229 %components%
230 .fi
231 .RE
232 .PP
233
234 Of course, replace "components" with a unique identifier that
235 reflects the content being included, like "mts_conf" for
236 etc/mts.conf. Then, add two lines to the man.sed target in
237 Makefile.in like:
238
239 echo '/%components%/r $(top_srcdir)/etc/components' >> $@
240 echo ' s,%components%,,g' >> $@
241
242 At compile time, the contents of the file will physically
243 incorporated into the body of the man page. This is somewhat
244 unfortunate, since later modifications won't be reflected in
245 the manpage, but on the other hand, the manpage will show the
246 default configuration and not local modifications.
247
248
249 Pointer Manpages
250
251 Certain manpages are shared between one or more programs
252 (such as folder/folders). The secondary program should
253 have a man page that only contains:
254
255 .so man1/folder.1
256
257 Also, add this manpage to the appropriate section in Makefile.in
258
259 AUTHOR and HISTORY Sections
260
261 These have no place in a manpage. If you want everlasting
262 glory, try the release notes. But note that a HISTORY
263 section might be appropriate for documenting incompatibility
264 with older versions of MH.
265
266 ------------------------------------------------------------------------------
267
268 [ This template is a bit behind the times. I will bring it into
269 conformance with the notes above once the notes settle down.
270 --lyndon ]
271
272
273 .TH COMP %manext1% "DATE" "%nmhversion%"
274 .\"
275 .\" %nmhwarning%
276 .\"
277 .SH NAME
278 comp \- compose a message
279 .\"
280 .SH SYNOPSIS
281 .HP 5
282 .na
283 .B comp
284 .RI [ +folder ]
285 .RI [ msgs ]
286 .RB [ \-form
287 .IR formfile ]
288 .RB [ \-use " | " \-nouse ]
289 .RB [ \-version ]
290 .RB [ \-help ]
291 .ad
292 .SH DESCRIPTION
293 .B Comp
294 is used to create a new message to be mailed.
295 It copies something.
296 .\"
297 .SH "PROFILE COMPONENTS"
298 .TP 20
299 Path
300 Location of the user's MH folder directory
301 .TP
302 moreproc
303 The pager command name
304 .\"
305 .SH DEFAULTS
306 .TP 20
307 .RI + folder
308 defaults to the current folder
309 .\"
310 .SH CONTEXT
311 None
312 .\"
313 .SH FILES
314 .TP 20
315 filename1
316 description of filename1
317 .TP
318 filename2
319 description of filename2
320 .\"
321 .SH "SEE ALSO"
322 .BR dist (1),
323 .BR forw (1),
324 .BR repl (1),
325 .BR send (1),
326 .BR whatnow (1),
327 .BR mh-profile (5)
328 .\" Leave out the BUGS section if there are none worth describing.
329 .SH BUGS
330 None
331