ronn-ng 0.7.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +7 -0
  2. data/AUTHORS +8 -0
  3. data/CHANGES +184 -0
  4. data/INSTALLING +20 -0
  5. data/LICENSE.txt +11 -0
  6. data/README.md +113 -0
  7. data/Rakefile +163 -0
  8. data/bin/ronn +223 -0
  9. data/config.ru +15 -0
  10. data/lib/ronn.rb +50 -0
  11. data/lib/ronn/document.rb +495 -0
  12. data/lib/ronn/index.rb +183 -0
  13. data/lib/ronn/roff.rb +302 -0
  14. data/lib/ronn/server.rb +70 -0
  15. data/lib/ronn/template.rb +171 -0
  16. data/lib/ronn/template/80c.css +6 -0
  17. data/lib/ronn/template/dark.css +18 -0
  18. data/lib/ronn/template/darktoc.css +17 -0
  19. data/lib/ronn/template/default.html +41 -0
  20. data/lib/ronn/template/man.css +100 -0
  21. data/lib/ronn/template/print.css +5 -0
  22. data/lib/ronn/template/screen.css +105 -0
  23. data/lib/ronn/template/toc.css +27 -0
  24. data/lib/ronn/utils.rb +55 -0
  25. data/man/index.html +78 -0
  26. data/man/index.txt +15 -0
  27. data/man/ronn-format.7 +201 -0
  28. data/man/ronn-format.7.ronn +157 -0
  29. data/man/ronn.1 +325 -0
  30. data/man/ronn.1.ronn +306 -0
  31. data/ronn-ng.gemspec +97 -0
  32. data/test/angle_bracket_syntax.html +18 -0
  33. data/test/angle_bracket_syntax.ronn +12 -0
  34. data/test/basic_document.html +9 -0
  35. data/test/basic_document.ronn +4 -0
  36. data/test/contest.rb +68 -0
  37. data/test/custom_title_document.html +6 -0
  38. data/test/custom_title_document.ronn +5 -0
  39. data/test/definition_list_syntax.html +21 -0
  40. data/test/definition_list_syntax.roff +26 -0
  41. data/test/definition_list_syntax.ronn +18 -0
  42. data/test/dots_at_line_start_test.roff +10 -0
  43. data/test/dots_at_line_start_test.ronn +4 -0
  44. data/test/entity_encoding_test.html +35 -0
  45. data/test/entity_encoding_test.roff +61 -0
  46. data/test/entity_encoding_test.ronn +25 -0
  47. data/test/index.txt +8 -0
  48. data/test/markdown_syntax.html +957 -0
  49. data/test/markdown_syntax.roff +1467 -0
  50. data/test/markdown_syntax.ronn +881 -0
  51. data/test/middle_paragraph.html +15 -0
  52. data/test/middle_paragraph.roff +13 -0
  53. data/test/middle_paragraph.ronn +10 -0
  54. data/test/missing_spaces.roff +9 -0
  55. data/test/missing_spaces.ronn +2 -0
  56. data/test/pre_block_with_quotes.roff +13 -0
  57. data/test/pre_block_with_quotes.ronn +6 -0
  58. data/test/section_reference_links.html +17 -0
  59. data/test/section_reference_links.roff +10 -0
  60. data/test/section_reference_links.ronn +12 -0
  61. data/test/test_ronn.rb +110 -0
  62. data/test/test_ronn_document.rb +186 -0
  63. data/test/test_ronn_index.rb +73 -0
  64. data/test/titleless_document.html +10 -0
  65. data/test/titleless_document.ronn +3 -0
  66. data/test/underline_spacing_test.roff +21 -0
  67. data/test/underline_spacing_test.ronn +11 -0
  68. metadata +176 -0
data/man/ronn.1 ADDED
@@ -0,0 +1,325 @@
1
+ .\" generated with Ronn/v0.7.0
2
+ .\" http://github.com/rtomayko/ronn/tree/0.7.0
3
+ .
4
+ .TH "RONN" "1" "June 2010" "Ronn 0.7.0" "Ronn Manual"
5
+ .
6
+ .SH "NAME"
7
+ \fBronn\fR \- convert markdown files to manpages
8
+ .
9
+ .SH "SYNOPSIS"
10
+ \fBronn\fR [\fIformat\fR\.\.\.] \fIfile\fR\.\.\.
11
+ .
12
+ .br
13
+ \fBronn\fR \fB\-m\fR|\fB\-\-man\fR \fIfile\fR\.\.\.
14
+ .
15
+ .br
16
+ \fBronn\fR \fB\-S\fR|\fB\-\-server\fR \fIfile\fR\.\.\.
17
+ .
18
+ .br
19
+ \fBronn\fR \fB\-\-pipe\fR \fIfile\fR
20
+ .
21
+ .br
22
+ \fBronn\fR < \fIfile\fR
23
+ .
24
+ .SH "DESCRIPTION"
25
+ \fBRonn\fR converts textfiles to standard roff\-formatted Unix manpages or HTML\. ronn\-format(7) is based on markdown(7) but includes additional rules and syntax geared toward authoring manuals\.
26
+ .
27
+ .P
28
+ In its default mode, \fBronn\fR converts one or more input \fIfile\fRs to HTML or roff output files\. The \fB\-\-roff\fR, \fB\-\-html\fR, and \fB\-\-fragment\fR options dictate which output files are generated\. Multiple format arguments may be specified to generate multiple output files\. Output files are named after and written to the same directory as input \fIfile\fRs\.
29
+ .
30
+ .P
31
+ The \fB\-\-server\fR and \fB\-\-man\fR options change the output behavior from file generation to serving dynamically generated HTML manpages or viewing \fIfile\fR as with man(1)\.
32
+ .
33
+ .P
34
+ With no \fIfile\fR arguments, \fBronn\fR acts as simple filter\. Ronn source text is read from standard input and roff output is written to standard output\. Use the \fB\-\-html\fR, \fB\-\-roff\fR, and/or \fB\-\-fragment\fR options to select the output format\.
35
+ .
36
+ .SH "FILES"
37
+ The \fBronn\fR command expects input to be valid ronn\-format(7) text\. Source files are typically named \fIname\fR\.\fIsection\fR\.ronn (e\.g\., \fBexample\.1\.ronn\fR)\. The \fIname\fR and \fIsection\fR should match the name and section defined in the \fIfile\fR\'s heading\.
38
+ .
39
+ .P
40
+ When building roff or HTML output files, destination filenames are determined by taking the basename of the input \fIfile\fR and adding the appropriate file extension (or removing the file extension in the case of roff output)\. For example, executing \fBronn example\.1\.ronn\fR generates \fBexample\.1\fR with roff output and \fBexample\.1\.html\fR with HTML output\.
41
+ .
42
+ .SH "OPTIONS"
43
+ These options control whether output is written to file(s), standard output, or directly to a man pager\.
44
+ .
45
+ .TP
46
+ \fB\-m\fR, \fB\-\-man\fR
47
+ Don\'t generate files, display \fIfile\fRs as if man(1) were invoked on the roff output file\. This simulates default man behavior by piping the roff output through groff(1) and the paging program specified by the \fBMANPAGER\fR environment variable\.
48
+ .
49
+ .TP
50
+ \fB\-S\fR, \fB\-\-server\fR
51
+ Don\'t generate files, start an HTTP server at \fIhttp://localhost:1207/\fR and serve dynamically generated HTML for the set of input \fIfile\fRs\. A file named \fIexample\.2\.ronn\fR is served as \fI/example\.2\.html\fR\. There\'s also an index page at the root with links to each \fIfile\fR\.
52
+ .
53
+ .IP
54
+ The server respects the \fB\-\-style\fR and document attribute options (\fB\-\-manual\fR, \fB\-\-date\fR, etc\.)\. These same options can be varied at request time by giving them as query parameters: \fB?manual=FOO&style=dark,toc\fR
55
+ .
56
+ .IP
57
+ \fINOTE: The builtin server is designed to assist in the process of writing and styling manuals\. It is in no way recommended as a general purpose web server\.\fR
58
+ .
59
+ .TP
60
+ \fB\-\-pipe\fR
61
+ Don\'t generate files, write generated output to standard output\. This is the default behavior when ronn source text is piped in on standard input and no \fIfile\fR arguments are provided\.
62
+ .
63
+ .P
64
+ Format options control the files \fBronn\fR generates, or the output format when the \fB\-\-pipe\fR argument is specified\. When no format options are given, both \fB\-\-roff\fR and \fB\-\-html\fR are assumed\.
65
+ .
66
+ .TP
67
+ \fB\-r\fR, \fB\-\-roff\fR
68
+ Generate roff output\. This is the default behavior when no \fIfile\fRs are given and ronn source text is read from standard input\.
69
+ .
70
+ .TP
71
+ \fB\-5\fR, \fB\-\-html\fR
72
+ Generate output in HTML format\.
73
+ .
74
+ .TP
75
+ \fB\-f\fR, \fB\-\-fragment\fR
76
+ Generate output in HTML format but only the document fragment, not the header, title, or footer\.
77
+ .
78
+ .P
79
+ Document attributes displayed in the header and footer areas of generated content are specified with these options\. (These values may also be set via the \fIENVIRONMENT\fR\.)
80
+ .
81
+ .TP
82
+ \fB\-\-manual\fR=\fImanual\fR
83
+ The name of the manual this man page belongs to; \fImanual\fR is prominently displayed top\-center in the header area\.
84
+ .
85
+ .TP
86
+ \fB\-\-organization\fR=\fIname\fR
87
+ The name of the group, organization, or individual responsible for publishing the document; \fIname\fR is displayed in the bottom\-left footer area\.
88
+ .
89
+ .TP
90
+ \fB\-\-date\fR=\fIdate\fR
91
+ The document\'s published date; \fIdate\fR must be formatted \fBYYYY\-MM\-DD\fR and is displayed in the bottom\-center footer area\. The \fIfile\fR mtime is used when no \fIdate\fR is given, or the current time when no \fIfile\fR is available\.
92
+ .
93
+ .P
94
+ HTML output can be customized through the use of CSS stylesheets:
95
+ .
96
+ .TP
97
+ \fB\-\-style\fR=\fImodule\fR[,\fImodule\fR]\.\.\.
98
+ The list of CSS stylesheets to apply to the document\. Multiple \fImodule\fR arguments may be specified, but must be separated by commas or spaces\.
99
+ .
100
+ .IP
101
+ When \fImodule\fR is a simple word, search for files named \fImodule\fR\fB\.css\fR in all directories listed in the \fI\fBRONN_STYLE\fR\fR environment variable, and then search internal styles\.
102
+ .
103
+ .IP
104
+ When \fImodule\fR includes a \fI/\fR character, use it as the full path to a stylesheet file\.
105
+ .
106
+ .IP
107
+ Internal styles are \fIman\fR (included by default), \fItoc\fR, and \fI80c\fR\. See \fISTYLES\fR for descriptions of features added by each module\.
108
+ .
109
+ .P
110
+ Miscellaneous options:
111
+ .
112
+ .TP
113
+ \fB\-w\fR, \fB\-\-warnings\fR
114
+ Show troff warnings on standard error when performing roff conversion\. Warnings are most often the result of a bug in ronn\'s HTML to roff conversion logic\.
115
+ .
116
+ .TP
117
+ \fB\-W\fR
118
+ Disable troff warnings\. Warnings are disabled by default\. This option can be used to revert the effect of a previous \fB\-w\fR argument\.
119
+ .
120
+ .TP
121
+ \fB\-v\fR, \fB\-\-version\fR
122
+ Show ronn version and exit\.
123
+ .
124
+ .SH "LINK INDEXES"
125
+ When generating HTML output, \fBronn\fR hyperlinks manual references (like \fBgrep(1)\fR, \fBls(1)\fR, \fBmarkdown(7)\fR) in source text based on reference name to URL mappings defined in an \fBindex\.txt\fR file\. Each line of the index file describes a single reference link, with whitespace separating the reference\'s \fIid\fR from its \fIlocation\fR\. Blank lines are allowed; lines beginning with a \fB#\fR character are ignored:
126
+ .
127
+ .IP "" 4
128
+ .
129
+ .nf
130
+
131
+ # manuals included in this project:
132
+ whisky(1) whisky\.1\.ronn
133
+ tango(5) tango\.5\.ronn
134
+
135
+ # external manuals
136
+ grep(1) http://man\.cx/grep(1)
137
+ ls(1) http://man\.cx/ls(1)
138
+
139
+ # other URLs for use with markdown reference links
140
+ src http://github\.com/
141
+ .
142
+ .fi
143
+ .
144
+ .IP "" 0
145
+ .
146
+ .P
147
+ The \fIlocation\fR is an absolute or relative URL that usually points at an HTML version of manpage\. It\'s possible to define references for things that aren\'t manpages\.
148
+ .
149
+ .P
150
+ All manuals in an individual directory share the references defined in that directory\'s \fBindex\.txt\fR file\. Index references may be used explicitly in Markdown reference style links using the syntax: \fB[\fR\fItext\fR\fB][\fR\fIid\fR\fB]\fR, where \fItext\fR is the link text and \fIid\fR is a reference name defined in the index\.
151
+ .
152
+ .SH "STYLES"
153
+ The \fB\-\-style\fR option selects a list of CSS stylesheets to include in the generated HTML\. Styles are applied in the order defined, so each can use the cascade to override previously defined styles\.
154
+ .
155
+ .SS "Builtin Stylesheets"
156
+ These styles are included with the distribution:
157
+ .
158
+ .TP
159
+ \fBman\fR
160
+ Basic manpage styles: typography, definition lists, indentation\. This is always included regardless of \fB\-\-style\fR argument\. It is however possible to replace the default \fBman\fR module with a custom one by placing a \fBman\.css\fR file on the \fBRONN_STYLE\fR path\.
161
+ .
162
+ .TP
163
+ \fBprint\fR
164
+ Basic print stylesheet\. The generated \fB<style>\fR tag includes a \fBmedia=print\fR attribute\.
165
+ .
166
+ .TP
167
+ \fBtoc\fR
168
+ Enables the Table of Contents navigation\. The TOC markup is included in generated HTML by default but hidden with an inline \fBdisplay:none\fR style rule; the \fBtoc\fR module turns it on and applies basic TOC styles\.
169
+ .
170
+ .TP
171
+ \fBdark\fR
172
+ Light text on a dark background\.
173
+ .
174
+ .TP
175
+ \fB80c\fR
176
+ Changes the display width to mimic the display of a classic 80 character terminal\. The default display width causes lines to wrap at a gratuitous 100 characters\.
177
+ .
178
+ .SS "Custom Stylesheets"
179
+ Writing custom stylesheets is straight\-forward\. The following core selectors allow targeting all generated elements:
180
+ .
181
+ .TP
182
+ \fB\.mp\fR
183
+ The manual page container element\. Present on full documents and document fragments\.
184
+ .
185
+ .TP
186
+ \fBbody#manpage\fR
187
+ Signifies that the page was fully\-generated by Ronn and contains a single manual page (\fB\.mp\fR element)\.
188
+ .
189
+ .TP
190
+ \fB\.man\-decor\fR
191
+ The three\-item heading and footing elements both have this class\.
192
+ .
193
+ .TP
194
+ \fB\.man\-head\fR, \fB\.man\-foot\fR
195
+ The heading and footing, respectively\.
196
+ .
197
+ .TP
198
+ \fB\.man\-title\fR
199
+ The main \fB<h1>\fR element\. Hidden by default unless the manual has no \fIname\fR or \fIsection\fR attributes\.
200
+ .
201
+ .P
202
+ See the builtin style sources \fIhttp://github\.com/rtomayko/ronn/tree/master/lib/ronn/template\fR for examples\.
203
+ .
204
+ .SH "EXAMPLES"
205
+ Build roff and HTML output files and view the roff manpage using man(1):
206
+ .
207
+ .IP "" 4
208
+ .
209
+ .nf
210
+
211
+ $ ronn some\-great\-program\.1\.ronn
212
+ roff: some\-great\-program\.1
213
+ html: some\-great\-program\.1\.html
214
+ $ man \./some\-great\-program\.1
215
+ .
216
+ .fi
217
+ .
218
+ .IP "" 0
219
+ .
220
+ .P
221
+ Build only the roff manpage for all \fB\.ronn\fR files in the current directory:
222
+ .
223
+ .IP "" 4
224
+ .
225
+ .nf
226
+
227
+ $ ronn \-\-roff *\.ronn
228
+ roff: mv\.1
229
+ roff: ls\.1
230
+ roff: cd\.1
231
+ roff: sh\.1
232
+ .
233
+ .fi
234
+ .
235
+ .IP "" 0
236
+ .
237
+ .P
238
+ Build only the HTML manpage for a few files and apply the \fBdark\fR and \fBtoc\fR stylesheets:
239
+ .
240
+ .IP "" 4
241
+ .
242
+ .nf
243
+
244
+ $ ronn \-\-html \-\-style=dark,toc mv\.1\.ronn ls\.1\.ronn
245
+ html: mv\.1\.html
246
+ html: ls\.1\.html
247
+ .
248
+ .fi
249
+ .
250
+ .IP "" 0
251
+ .
252
+ .P
253
+ Generate roff output on standard output and write to file:
254
+ .
255
+ .IP "" 4
256
+ .
257
+ .nf
258
+
259
+ $ ronn <hello\.1\.ronn >hello\.1
260
+ .
261
+ .fi
262
+ .
263
+ .IP "" 0
264
+ .
265
+ .P
266
+ View a ronn file in the same way as man(1) without building a roff file:
267
+ .
268
+ .IP "" 4
269
+ .
270
+ .nf
271
+
272
+ $ ronn \-\-man hello\.1\.ronn
273
+ .
274
+ .fi
275
+ .
276
+ .IP "" 0
277
+ .
278
+ .P
279
+ Serve HTML manpages at \fIhttp://localhost:1207/\fR for all \fB*\.ronn\fR files under a \fBman/\fR directory:
280
+ .
281
+ .IP "" 4
282
+ .
283
+ .nf
284
+
285
+ $ ronn \-\-server man/*\.ronn
286
+ $ open http://localhost:1207/
287
+ .
288
+ .fi
289
+ .
290
+ .IP "" 0
291
+ .
292
+ .SH "ENVIRONMENT"
293
+ .
294
+ .TP
295
+ \fBRONN_MANUAL\fR
296
+ A default manual name to be displayed in the top\-center header area\. The \fB\-\-manual\fR option takes precedence over this value\.
297
+ .
298
+ .TP
299
+ \fBRONN_ORGANIZATION\fR
300
+ The default manual publishing group, organization, or individual to be displayed in the bottom\-left footer area\. The \fB\-\-organization\fR option takes precedence over this value\.
301
+ .
302
+ .TP
303
+ \fBRONN_DATE\fR
304
+ The default manual date in \fBYYYY\-MM\-DD\fR format\. Displayed in the bottom\-center footer area\. The \fB\-\-date\fR option takes precedence over this value\.
305
+ .
306
+ .TP
307
+ \fBRONN_STYLE\fR
308
+ A \fBPATH\fR\-style list of directories to check for stylesheets given to the \fB\-\-style\fR option\. Directories are separated by a \fI:\fR; blank entries are ignored\. Use \fI\.\fR to include the current working directory\.
309
+ .
310
+ .TP
311
+ \fBMANPAGER\fR
312
+ The paging program used for man pages\. This is typically set to something like \'less \-is\'\.
313
+ .
314
+ .TP
315
+ \fBPAGER\fR
316
+ Used instead of \fBMANPAGER\fR when \fBMANPAGER\fR is not defined\.
317
+ .
318
+ .SH "BUGS"
319
+ \fBRonn\fR is written in Ruby and depends on hpricot and rdiscount, extension libraries that are non\-trivial to install on some systems\. A more portable version of this program would be welcome\.
320
+ .
321
+ .SH "COPYRIGHT"
322
+ Ronn is Copyright (C) 2009 Ryan Tomayko \fIhttp://tomayko\.com/about\fR
323
+ .
324
+ .SH "SEE ALSO"
325
+ ronn\-format(7), manpages(5), man(1), roff(7), groff(1), markdown(7)
data/man/ronn.1.ronn ADDED
@@ -0,0 +1,306 @@
1
+ ronn(1) -- convert markdown files to manpages
2
+ =============================================
3
+
4
+ ## SYNOPSIS
5
+
6
+ `ronn` [<format>...] <file>...<br>
7
+ `ronn` `-m`|`--man` <file>...<br>
8
+ `ronn` `-S`|`--server` <file>...<br>
9
+ `ronn` `--pipe` <file><br>
10
+ `ronn` &lt; <file>
11
+
12
+ ## DESCRIPTION
13
+
14
+ **Ronn** converts textfiles to standard roff-formatted Unix manpages or HTML.
15
+ ronn-format(7) is based on markdown(7) but includes additional rules and syntax
16
+ geared toward authoring manuals.
17
+
18
+ In its default mode, `ronn` converts one or more input <file>s to HTML or roff
19
+ output files. The `--roff`, `--html`, and `--fragment` options dictate which
20
+ output files are generated. Multiple format arguments may be specified to
21
+ generate multiple output files. Output files are named after and written to the
22
+ same directory as input <file>s.
23
+
24
+ The `--server` and `--man` options change the output behavior from file
25
+ generation to serving dynamically generated HTML manpages or viewing <file> as
26
+ with man(1).
27
+
28
+ With no <file> arguments, `ronn` acts as simple filter. Ronn source text is read
29
+ from standard input and roff output is written to standard output. Use the
30
+ `--html`, `--roff`, and/or `--fragment` options to select the output format.
31
+
32
+ ## FILES
33
+
34
+ The `ronn` command expects input to be valid ronn-format(7) text. Source files
35
+ are typically named <name>.<section>.ronn (e.g., `example.1.ronn`). The <name>
36
+ and <section> should match the name and section defined in the <file>'s heading.
37
+
38
+ When building roff or HTML output files, destination filenames are determined by
39
+ taking the basename of the input <file> and adding the appropriate file
40
+ extension (or removing the file extension in the case of roff output). For
41
+ example, executing `ronn example.1.ronn` generates `example.1` with roff output
42
+ and `example.1.html` with HTML output.
43
+
44
+ ## OPTIONS
45
+
46
+ These options control whether output is written to file(s), standard output, or
47
+ directly to a man pager.
48
+
49
+ * `-m`, `--man`:
50
+ Don't generate files, display <file>s as if man(1) were invoked on the roff
51
+ output file. This simulates default man behavior by piping the roff output
52
+ through groff(1) and the paging program specified by the `MANPAGER`
53
+ environment variable.
54
+
55
+ * `-S`, `--server`:
56
+ Don't generate files, start an HTTP server at <http://localhost:1207/> and
57
+ serve dynamically generated HTML for the set of input <file>s. A file named
58
+ *example.2.ronn* is served as */example.2.html*. There's also an index page
59
+ at the root with links to each <file>.
60
+
61
+ The server respects the `--style` and document attribute options
62
+ (`--manual`, `--date`, etc.). These same options can be varied at request
63
+ time by giving them as query parameters: `?manual=FOO&style=dark,toc`
64
+
65
+ *NOTE: The builtin server is designed to assist in the process of writing
66
+ and styling manuals. It is in no way recommended as a general purpose web
67
+ server.*
68
+
69
+ * `--pipe`:
70
+ Don't generate files, write generated output to standard output. This is the
71
+ default behavior when ronn source text is piped in on standard input and no
72
+ <file> arguments are provided.
73
+
74
+ Format options control the files `ronn` generates, or the output format when the
75
+ `--pipe` argument is specified. When no format options are given, both `--roff`
76
+ and `--html` are assumed.
77
+
78
+ * `-r`, `--roff`:
79
+ Generate roff output. This is the default behavior when no <file>s are given
80
+ and ronn source text is read from standard input.
81
+
82
+ * `-5`, `--html`:
83
+ Generate output in HTML format.
84
+
85
+ * `-f`, `--fragment`:
86
+ Generate output in HTML format but only the document fragment, not the
87
+ header, title, or footer.
88
+
89
+ Document attributes displayed in the header and footer areas of generated
90
+ content are specified with these options. (These values may also be set via
91
+ the [ENVIRONMENT][].)
92
+
93
+ * `--manual`=<manual>:
94
+ The name of the manual this man page belongs to; <manual> is prominently
95
+ displayed top-center in the header area.
96
+
97
+ * `--organization`=<name>:
98
+ The name of the group, organization, or individual responsible for
99
+ publishing the document; <name> is displayed in the bottom-left footer area.
100
+
101
+ * `--date`=<date>:
102
+ The document's published date; <date> must be formatted `YYYY-MM-DD` and is
103
+ displayed in the bottom-center footer area. The <file> mtime is used when no
104
+ <date> is given, or the current time when no <file> is available.
105
+
106
+ HTML output can be customized through the use of CSS stylesheets:
107
+
108
+ * `--style`=<module>[,<module>]...:
109
+ The list of CSS stylesheets to apply to the document. Multiple <module>
110
+ arguments may be specified, but must be separated by commas or spaces.
111
+
112
+ When <module> is a simple word, search for files named <module>`.css` in all
113
+ directories listed in the [`RONN_STYLE`](#ENVIRONMENT) environment variable,
114
+ and then search internal styles.
115
+
116
+ When <module> includes a _/_ character, use it as the full path to a
117
+ stylesheet file.
118
+
119
+ Internal styles are _man_ (included by default), _toc_, and _80c_. See
120
+ [STYLES][] for descriptions of features added by each module.
121
+
122
+ Miscellaneous options:
123
+
124
+ * `-w`, `--warnings`:
125
+ Show troff warnings on standard error when performing roff conversion.
126
+ Warnings are most often the result of a bug in ronn's HTML to roff conversion
127
+ logic.
128
+
129
+ * `-W`:
130
+ Disable troff warnings. Warnings are disabled by default. This option can be
131
+ used to revert the effect of a previous `-w` argument.
132
+
133
+ * `-v`, `--version`:
134
+ Show ronn version and exit.
135
+
136
+ ## LINK INDEXES
137
+
138
+ When generating HTML output, `ronn` hyperlinks manual references (like
139
+ `grep(1)`, `ls(1)`, `markdown(7)`) in source text based on reference name to URL
140
+ mappings defined in an `index.txt` file. Each line of the index file describes a
141
+ single reference link, with whitespace separating the reference's <id> from its
142
+ <location>. Blank lines are allowed; lines beginning with a `#` character are
143
+ ignored:
144
+
145
+ # manuals included in this project:
146
+ whisky(1) whisky.1.ronn
147
+ tango(5) tango.5.ronn
148
+
149
+ # external manuals
150
+ grep(1) http://man.cx/grep(1)
151
+ ls(1) http://man.cx/ls(1)
152
+
153
+ # other URLs for use with markdown reference links
154
+ src http://github.com/
155
+
156
+ The <location> is an absolute or relative URL that usually points at an HTML
157
+ version of manpage. It's possible to define references for things that aren't
158
+ manpages.
159
+
160
+ All manuals in an individual directory share the references defined in that
161
+ directory's `index.txt` file. Index references may be used explicitly in
162
+ Markdown reference style links using the syntax: `[`<text>`][`<id>`]`, where
163
+ <text> is the link text and <id> is a reference name defined in the index.
164
+
165
+ ## STYLES
166
+
167
+ The `--style` option selects a list of CSS stylesheets to include in the
168
+ generated HTML. Styles are applied in the order defined, so each can use the
169
+ cascade to override previously defined styles.
170
+
171
+ ### Builtin Stylesheets
172
+
173
+ These styles are included with the distribution:
174
+
175
+ * `man`:
176
+ Basic manpage styles: typography, definition lists, indentation. This is
177
+ always included regardless of `--style` argument. It is however possible to
178
+ replace the default `man` module with a custom one by placing a `man.css`
179
+ file on the `RONN_STYLE` path.
180
+
181
+ * `print`:
182
+ Basic print stylesheet. The generated `<style>` tag includes a
183
+ `media=print` attribute.
184
+
185
+ * `toc`:
186
+ Enables the Table of Contents navigation. The TOC markup is included in
187
+ generated HTML by default but hidden with an inline `display:none` style
188
+ rule; the `toc` module turns it on and applies basic TOC styles.
189
+
190
+ * `dark`:
191
+ Light text on a dark background.
192
+
193
+ * `80c`:
194
+ Changes the display width to mimic the display of a classic 80 character
195
+ terminal. The default display width causes lines to wrap at a gratuitous
196
+ 100 characters.
197
+
198
+ ### Custom Stylesheets
199
+
200
+ Writing custom stylesheets is straight-forward. The following core selectors
201
+ allow targeting all generated elements:
202
+
203
+ * `.mp`:
204
+ The manual page container element. Present on full documents and document
205
+ fragments.
206
+
207
+ * `body#manpage`:
208
+ Signifies that the page was fully-generated by Ronn and contains a single
209
+ manual page (`.mp` element).
210
+
211
+ * `.man-decor`:
212
+ The three-item heading and footing elements both have this class.
213
+
214
+ * `.man-head`, `.man-foot`:
215
+ The heading and footing, respectively.
216
+
217
+ * `.man-title`:
218
+ The main `<h1>` element. Hidden by default unless the manual has no <name>
219
+ or <section> attributes.
220
+
221
+ See the [builtin style sources][builtin] for examples.
222
+
223
+ [builtin]: http://github.com/apjanke/ronn-ng/tree/master/lib/ronn/template
224
+ "Builtin Stylesheet .css files"
225
+
226
+ ## EXAMPLES
227
+
228
+ Build roff and HTML output files and view the roff manpage using man(1):
229
+
230
+ $ ronn some-great-program.1.ronn
231
+ roff: some-great-program.1
232
+ html: some-great-program.1.html
233
+ $ man ./some-great-program.1
234
+
235
+ Build only the roff manpage for all `.ronn` files in the current directory:
236
+
237
+ $ ronn --roff *.ronn
238
+ roff: mv.1
239
+ roff: ls.1
240
+ roff: cd.1
241
+ roff: sh.1
242
+
243
+ Build only the HTML manpage for a few files and apply the `dark` and `toc`
244
+ stylesheets:
245
+
246
+ $ ronn --html --style=dark,toc mv.1.ronn ls.1.ronn
247
+ html: mv.1.html
248
+ html: ls.1.html
249
+
250
+ Generate roff output on standard output and write to file:
251
+
252
+ $ ronn <hello.1.ronn >hello.1
253
+
254
+ View a ronn file in the same way as man(1) without building a roff file:
255
+
256
+ $ ronn --man hello.1.ronn
257
+
258
+ Serve HTML manpages at <http://localhost:1207/> for all `*.ronn` files
259
+ under a `man/` directory:
260
+
261
+ $ ronn --server man/*.ronn
262
+ $ open http://localhost:1207/
263
+
264
+
265
+ ## ENVIRONMENT
266
+
267
+ * `RONN_MANUAL`:
268
+ A default manual name to be displayed in the top-center header area.
269
+ The `--manual` option takes precedence over this value.
270
+
271
+ * `RONN_ORGANIZATION`:
272
+ The default manual publishing group, organization, or individual to be
273
+ displayed in the bottom-left footer area. The `--organization` option takes
274
+ precedence over this value.
275
+
276
+ * `RONN_DATE`:
277
+ The default manual date in `YYYY-MM-DD` format. Displayed in the
278
+ bottom-center footer area. The `--date` option takes precedence over this
279
+ value.
280
+
281
+ * `RONN_STYLE`:
282
+ A `PATH`-style list of directories to check for stylesheets given to the
283
+ `--style` option. Directories are separated by a _:_; blank entries are
284
+ ignored. Use _._ to include the current working directory.
285
+
286
+ * `MANPAGER`:
287
+ The paging program used for man pages. This is typically set to
288
+ something like 'less -is'.
289
+
290
+ * `PAGER`:
291
+ Used instead of `MANPAGER` when `MANPAGER` is not defined.
292
+
293
+ ## BUGS
294
+
295
+ **Ronn** is written in Ruby and depends on hpricot and rdiscount, extension
296
+ libraries that are non-trivial to install on some systems. A more portable
297
+ version of this program would be welcome.
298
+
299
+ ## COPYRIGHT
300
+
301
+ Ronn-NG is Copyright (C) 2009 Ryan Tomayko <http://tomayko.com/about> and
302
+ (C) 2018 Andrew Janke <https://apjanke.net>
303
+
304
+ ## SEE ALSO
305
+
306
+ groff(1), man(1), pandoc(1), manpages(5), markdown(7), roff(7), ronn-format(7)