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