1src2man(1) src2man(1)
2
3
4
6 src2man - extract man pages from source files.
7
9 src2man [-n][-d date][-v volume][-r release] [srcfile ...]
10
12 src2man scans source file srcfile. Only C source files are supported
13 for now. Comments blocks starting by "/** num", where num is a section
14 number, are converted into a man file, using txt2man(1).
15
16 The first line of the comment block must contain the name of the man‐
17 page, usually the function name, followed by a "-" and a short descrip‐
18 tion. The following lines are the "DESCRIPTION" section content, except
19 if they are in upper case, in which case they define a new section.
20
21 If the next line after a comment block is empty, Then no "SYNOPSIS"
22 section will be generated. Otherwise, src2man will look in the follow‐
23 ing source lines for a function prototype or a type definion (struct,
24 union, typedef, ...) matching the manpage name, and include it in a
25 "SYNOPSIS" section. This avoids to duplicate the type or function pro‐
26 totype in the comment block.
27
28 The best place for code documentation is in the source file, where the
29 body is implemented, not the header file which only contains the proto‐
30 type. src2man automatically searches for the presence of a prototype in
31 the corresponding header file, and if found, will print a "#include"
32 statement in the synopsis.
33
35 -d date
36 Set the date of the man pages. Defaults to current date.
37
38 -n No man page is created. The name of the manpages that would be
39 created are printed.
40
41 -v volume
42 Specify the name of the volume to be printed in center header of
43 generated manpages.
44
45 -r release
46 Specify the project name and release number for the generated
47 manpage.
48
50 The following example displays C code and comments to generate a man‐
51 page foobar.3:
52
53 /** 3
54 * foobar - a sample dummy function
55 * This line is now the first of the description section.
56 * Note that function parameters parm1 and parm2 are highlighted
57 * in the generated man page.
58 */
59 int foobar(char *parm1, int parm2)
60 {
61 ...
62 return 0;
63 }
64
65
67 txt2man(1), bookman(1).
68
70 Marc Vertes <mvertes@free.fr>
71
72
73
74txt2man-1.5.6 16 March 2011 src2man(1)