1scdoc(5) File Formats Manual scdoc(5)
2
3
4
6 scdoc - document format for writing manual pages
7
9 Input files must use the UTF-8 encoding.
10
11 PREAMBLE
12 Each scdoc file must begin with the following preamble:
13
14 name(section) ["left_footer" ["center_header"]]
15
16 name is the name of the man page you are writing, and section is the
17 section you're writing for (see man(1) for information on manual sec‐
18 tions).
19
20 left_footer and center_header are optional arguments which set the text
21 positioned at those locations in the generated man page, and must be
22 surrounded with double quotes.
23
24 SECTION HEADERS
25 Each section of your man page should begin with something similar to
26 the following:
27
28 # HEADER NAME
29
30 Subsection headers are also understood - use two hashes. Each header
31 must have an empty line on either side.
32
33 PARAGRAPHS
34 Begin a new paragraph with an empty line.
35
36 LINE BREAKS
37 Insert a line break by ending a line with ++.
38
39 The result looks
40 like this.
41
42 FORMATTING
43 Text can be made bold or underlined with asterisks and underscores:
44 *bold* or _underlined_. Underscores in the_middle_of_words will be dis‐
45 regarded.
46
47 INDENTATION
48 You may indent lines with tab characters (\t) to indent them by 4 spa‐
49 ces in the output. Indented lines may not contain headers.
50
51 The result looks something like this.
52
53 You may use multiple lines and most formatting.
54
55 Deindent to return to normal, or indent again to increase your indenta‐
56 tion depth.
57
58 LISTS
59 You may start bulleted lists with dashes (-), like so:
60
61 - Item 1
62 - Item 2
63 - Subitem 1
64 - Subitem 2
65 - Item 3
66
67 The result looks like this:
68
69 · Item 1
70 · Item 2
71 · Subitem 1
72 · Subitem 2
73 · Item 3
74
75
76 You may also extend long entries onto another line by giving it the
77 same indent level, plus two spaces. They will be rendered as a single
78 list entry.
79
80 - Item 1 is pretty long so let's
81 break it up onto two lines
82 - Item 2 is shorter
83 - But its children can go on
84 for a while
85
86 · Item 1 is pretty long so let's break it up onto two lines
87 · Item 2 is shorter
88 · But its children can go on for a while
89
90
91 NUMBERED LISTS
92 Numbered lists are similar to normal lists, but begin with periods (.)
93 instead of dashes (-), like so:
94
95 . Item 1
96 . Item 2
97 . Item 3,
98 with multiple lines
99
100 1. Item 1
101 2. Item 2
102 3. Item 3, with multiple lines
103
104
105 TABLES
106 To begin a table, add an empty line followed by any number of rows.
107
108 Each line of a table should start with | or : to start a new row or
109 column respectively (or space to continue the previous cell on multiple
110 lines), followed by [ or - or ] to align the contents to the left, cen‐
111 ter, or right, followed by a space and the contents of that cell. You
112 may use a space instead of an alignment specifier to inherit the align‐
113 ment of the same column in the previous row.
114
115 The first character of the first row is not limited to | and has spe‐
116 cial meaning. [ will produce a table with borders around each cell. |
117 will produce a table with no borders. ] will produce a table with one
118 border around the whole table.
119
120 To conclude your table, add an empty line after the last row.
121
122 [[ *Foo*
123 :- _Bar_
124 :-
125 | *Row 1*
126 : Hello
127 :] world!
128 | *Row 2*
129 : こんにちは
130 : 世界
131 !
132
133 ┌──────┬────────────┬────────┐
134 │Foo │ Bar │ │
135 ├──────┼────────────┼────────┤
136 │Row 1 │ Hello │ world! │
137 ├──────┼────────────┼────────┤
138 │Row 2 │ こんにちは │ 世界 ! │
139 └──────┴────────────┴────────┘
140
141 LITERAL TEXT
142 You may turn off scdoc formatting and output literal text with escape
143 codes and literal blocks. Inserting a \ into your source will cause the
144 subsequent symbol to be treated as a literal and copied directly to the
145 output. You may also make blocks of literal syntax like so:
146
147 ```
148 _This formatting_ will *not* be interpreted by scdoc.
149 ```
150
151 These blocks will be indented one level. Note that literal text is
152 shown literally in the man viewer - that is, it's not a means for
153 inserting your own roff macros into the output. Note that \ is still
154 interpreted within literal blocks, which for example can be useful to
155 output ``` inside of a literal block.
156
157 COMMENTS
158 Lines beginning with ; and a space are ignored.
159
160 ; This is a comment
161
163 By convention, all scdoc documents should be hard wrapped at 80 col‐
164 umns.
165
167 scdoc(1)
168
170 Maintained by Drew DeVault <sir@cmpwn.com>. Up-to-date sources can be
171 found at https://git.sr.ht/~sircmpwn/scdoc and bugs/patches can be sub‐
172 mitted by email to ~sircmpwn/public-inbox@lists.sr.ht.
173
174
175
176 2019-03-12 scdoc(5)