ron 0.1 → 0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/man/ron.5.ron CHANGED
@@ -3,6 +3,8 @@ ron(5) -- humane manual page authoring format
3
3
 
4
4
  ## SYNOPSIS
5
5
 
6
+ A basic manual page in Ron:
7
+
6
8
  name(1) -- one sentence description
7
9
  ===================================
8
10
 
@@ -14,50 +16,50 @@ ron(5) -- humane manual page authoring format
14
16
 
15
17
  ## INLINE MARKUP
16
18
 
17
- Inline markup should be used for `code` (displayed in
18
- boldface) and _variables_ (displayed in underline).
19
+ Inline markup is used for `code` and `user input` (displayed
20
+ in boldface), and also <variables> or _emphasis_.
19
21
 
20
22
  Manual page references like sh(1), markdown(5), roff(7), etc.
21
23
  are displayed in boldface and hyperlinked in HTML output.
22
24
 
23
25
  ## DEFINITION LISTS
24
26
 
25
- Definition lists are used to define arguments, variables,
26
- or other terms:
27
+ Definition lists are used to define options, arguments,
28
+ variables, and other type of terms:
27
29
 
28
30
  * `-a`, `--arg1`=[_OPTION_]:
29
- One or more paragraphs describing the
31
+ One or more paragraphs describing the argument.
30
32
  * `-b`, `--arg2`:
31
- Any number of these may be specified and they can be
32
- nested.
33
+ Any number of these may be specified and may
34
+ be nested.
33
35
 
34
36
  ## DESCRIPTION
35
37
 
36
- `Ron` files are simple ascii texts that document things in the
38
+ Ron files are simple ascii texts that document things in the
37
39
  style of UNIX man pages but with a syntax and feature-set less
38
- insane than that of roff(7). `Ron` files are piped through
39
- ron(1) to build and install traditional roff(7) man pages or
40
- to generate hyperlinked HTML documentation.
40
+ insane than that of roff(7). Ron files are piped through ron(1)
41
+ to build and install traditional roff(7) man pages or to generate
42
+ hyperlinked HTML documentation.
41
43
 
42
- All `ron` files must conform to a simple subset of markdown(5), a
43
- humane text markup designed for writing on the web. It is neither
44
- possible nor desirable to express many of roff(7)'s complex
45
- typesetting features in `ron`.
44
+ All ron formatted files must conform to a simple subset of
45
+ markdown(5), a humane text markup designed for writing on the
46
+ web. It is neither possible nor desirable to express many of
47
+ roff(7)'s complex typesetting features in ron.
46
48
 
47
49
  ## MANPAGE TITLE
48
50
 
49
- All man pages have a _name_, belong to a _section_, and have a
50
- single sentence _tagline_ (useless but witty, preferably). `Ron`
51
+ All man pages have a <name>, belong to a <section>, and have a
52
+ single sentence <tagline> (useless but witty, preferably). Ron
51
53
  files must begin with a first-level heading that includes all of
52
54
  this information. For example, this very man page begins:
53
55
 
54
56
  ron(5) -- humane manual page authoring format
55
57
  =============================================
56
58
 
57
- Here, we're saying that the man page documents a thing named `ron`
58
- in manual section `5` -- the "file formats" section; see
59
- manpages(5) for full section list -- and that's quickly
60
- described as a "humane manual page authoring format".
59
+ Here, we're saying that the man page documents a thing named
60
+ `ron` in manual section `5` (the "file formats" section; see
61
+ manpages(5) for full section list) and that's quickly described
62
+ as a "humane manual page authoring format".
61
63
 
62
64
  These bits of information are used to fill in the document
63
65
  header, to create the `NAME` section, and also to establish
@@ -89,21 +91,23 @@ pages and external documents.
89
91
 
90
92
  ## INLINE MARKUP
91
93
 
92
- Man pages typically use a limited set of text formatting
93
- capabilities. There's basically <b>boldface</b> and
94
- <i>italics</i> (often displayed using <u>underline</u>). Ron
95
- uses the following bits of markdown(5) to accomplish this:
94
+ Man pages have a limited set of text formatting capabilities at
95
+ their disposal. There's basically <b>boldface</b> and
96
+ <i>italics</i> (often displayed using <u>underline</u>). Ron uses
97
+ the following bits of markdown(5) to accomplish this:
96
98
 
97
99
  * <code>\`backticks\`</code>:
98
100
  Code, flags, commands, and noun-like things; typically
99
101
  displayed in in <b>boldface</b>. Note that all text included
100
102
  within `backticks` is displayed literally; other inline markup
101
103
  is not processed.
104
+ * `**double-stars**`:
105
+ Like `backticks` but inline markup is processed.
102
106
  * `_`_underbars_`_`:
103
107
  User-specified arguments, variables, or user input; typically
104
- displayed in <u>underline</u>.
105
- * `**double stars**`:
106
- Like `backticks` but may contain other inline markup.
108
+ displayed with <u>underline</u>.
109
+ * `<angle-quotes>`:
110
+ Same as _underbars_. This is not compatible with Markdown.
107
111
 
108
112
  Here is grep(1)'s DESCRIPTION section represented in `ron`:
109
113
 
@@ -119,15 +123,15 @@ describe arguments, options, and variables, the basic markdown(5)
119
123
  list syntax has been extended to support a definition list
120
124
  syntax.
121
125
 
122
- A definition list's syntax is exactly the same as markdown(5)'s
126
+ Definition list syntax is exactly the same as markdown(5)'s
123
127
  unordered list syntax but requires that the first line of each
124
- list item be terminated with a colon "`:`". The first line
125
- (minus the colon) is the _term_; subsequent lines may be
126
- comprised of multiple paragraphs, code blocks, standard lists,
127
- and nested definition lists.
128
+ list item be terminated with a colon "`:`". The first line (minus
129
+ the colon) is the <term>; subsequent lines may be comprised of
130
+ multiple paragraphs, code blocks, standard lists, and nested
131
+ definition lists.
128
132
 
129
- An example definition list, taken from test(1)'s `DESCRIPTION`
130
- section:
133
+ An example definition list, taken from BSD test(1)'s
134
+ `DESCRIPTION` section:
131
135
 
132
136
  The following primaries are used to construct expressions:
133
137
 
data/man/ron.7 ADDED
@@ -0,0 +1,201 @@
1
+ .\" generated with Ron/v0.2
2
+ .\" http://github.com/rtomayko/ron/
3
+ .
4
+ .TH "RON" "7" "December 2009" "Ryan Tomayko" "Ron Manual"
5
+ .
6
+ .SH "NAME"
7
+ \fBron\fR \-\- the opposite of roff
8
+ .
9
+ .SH "DESCRIPTION"
10
+ Ron is a humane text format and toolchain for creating UNIX man
11
+ pages, and things that appear as man pages from a distance. Use it
12
+ to build and install standard UNIX roff man pages or to generate
13
+ nicely formatted HTML manual pages for the web.
14
+ .
15
+ .P
16
+ The Ron file format is based on Markdown. In fact, Ron files are a
17
+ compatible subset of Markdown syntax but have a more rigid structure and
18
+ extend Markdown in some ways to provide features commonly found in man
19
+ pages (e.g., definition lists). The ron(5) manual page defines the
20
+ format in more detail.
21
+ .
22
+ .SH "DOCUMENTATION"
23
+ The \fB.ron\fR files located under the \fBman/\fR directory show off a wide
24
+ range of ron capabilities and are the source of Ron's own documentation.
25
+ The source files and generated HTML / roff output files are available
26
+ at:
27
+ .
28
+ .IP "\(bu" 4
29
+ \fIron(1)\fR \-
30
+ build markdown based manual pages at the command line.
31
+ .
32
+ .br
33
+ \fIsource file\fR, \fIroff output\fR
34
+ .
35
+ .IP "\(bu" 4
36
+ \fIron(5)\fR \-
37
+ humane manual page authoring format syntax reference.
38
+ .
39
+ .br
40
+ \fIsource file\fR, \fIroff output\fR
41
+ .
42
+ .IP "\(bu" 4
43
+ \fImarkdown(5)\fR \-
44
+ humane text markup syntax (taken from \fIMarkdown Syntax\fR,
45
+ John Gruber)
46
+ .
47
+ .br
48
+ \fIsource file\fR, \fIroff output\fR
49
+ .
50
+ .IP "" 0
51
+ .
52
+ .SH "INSTALL"
53
+ Install with Rubygems:
54
+ .
55
+ .IP "" 4
56
+ .
57
+ .nf
58
+
59
+ $ [sudo] gem install ron
60
+ $ ron \-\-help
61
+ .
62
+ .fi
63
+ .
64
+ .IP "" 0
65
+ .
66
+ .P
67
+ Or, clone the git repository:
68
+ .
69
+ .IP "" 4
70
+ .
71
+ .nf
72
+
73
+ $ git clone git://github.com/rtomayko/ron.git
74
+ $ PATH=ron/bin:$PATH
75
+ $ ron \-\-help
76
+ .
77
+ .fi
78
+ .
79
+ .IP "" 0
80
+ .
81
+ .SH "BASIC USAGE"
82
+ To generate a roff man page from the included\fI\fBmarkdown.5.ron\fR\fR file and open it with man(1):
83
+ .
84
+ .IP "" 4
85
+ .
86
+ .nf
87
+
88
+ $ ron \-b man/markdown.5.ron
89
+ building: man/markdown.5
90
+ $ man man/markdown.5
91
+ .
92
+ .fi
93
+ .
94
+ .IP "" 0
95
+ .
96
+ .P
97
+ To generate a standalone HTML version:
98
+ .
99
+ .IP "" 4
100
+ .
101
+ .nf
102
+
103
+ $ ron \-b \-\-html man/markdown.5.ron
104
+ building: man/markdown.5.html
105
+ $ open man/markdown.5.html
106
+ .
107
+ .fi
108
+ .
109
+ .IP "" 0
110
+ .
111
+ .P
112
+ To build roff and HTML versions of all ron files:
113
+ .
114
+ .IP "" 4
115
+ .
116
+ .nf
117
+
118
+ $ ron \-b \-\-roff \-\-html man/*.ron
119
+ .
120
+ .fi
121
+ .
122
+ .IP "" 0
123
+ .
124
+ .P
125
+ If you just want to view a ron file as if it were a man page without
126
+ building intermediate files:
127
+ .
128
+ .IP "" 4
129
+ .
130
+ .nf
131
+
132
+ $ ron \-m man/markdown.5.ron
133
+ .
134
+ .fi
135
+ .
136
+ .IP "" 0
137
+ .
138
+ .P
139
+ The \fIron(1)\fR manual page
140
+ includes comprehensive documentation on \fBron\fR command line options.
141
+ .
142
+ .SH "ABOUT"
143
+ Some people think UNIX manual pages are a poor and outdated style of
144
+ documentation. I disagree:
145
+ .
146
+ .IP "\(bu" 4
147
+ Man pages follow a well defined structure that's immediately
148
+ familiar and provides a useful starting point for developers
149
+ documenting new tools, libraries, and formats.
150
+ .
151
+ .IP "\(bu" 4
152
+ Man pages get to the point. Because they're written in an inverted
153
+ style, with a SYNOPSIS section followed by additional detail,
154
+ prose and references to other sources of information, man pages
155
+ provide the best of both cheat sheet and reference style
156
+ documentation.
157
+ .
158
+ .IP "\(bu" 4
159
+ Man pages have extremely \-\- unbelievably \-\- limited text
160
+ formatting capabilities. You get a couple of headings, lists, bold,
161
+ underline and no more. This is a feature.
162
+ .
163
+ .IP "\(bu" 4
164
+ Although two levels of section hierarchy are technically
165
+ supported, most man pages use only a single level. Unwieldy
166
+ document hierarchies complicate otherwise good documentation.
167
+ Feynman covered all of physics \-\- heavenly bodies through QED \-\-
168
+ with only two levels of document hierarchy (\fIThe Feynman Lectures
169
+ on Physics\fR, 1970).
170
+ .
171
+ .IP "\(bu" 4
172
+ Man pages have a simple referencing syntax; e.g., sh(1), fork(2),
173
+ markdown(5). HTML versions can use this to generate links between
174
+ pages.
175
+ .
176
+ .IP "\(bu" 4
177
+ The classical terminal man page display is typographically well
178
+ thought out. Big bold section headings, justified monospace text,
179
+ nicely indented paragraphs, intelligently aligned definition
180
+ lists, and an informational header and footer.
181
+ .
182
+ .IP "" 0
183
+ .
184
+ .P
185
+ Unfortunately, trying to figure out how to create a man page is a
186
+ fairly tedious process. The roff/man macro languages are highly
187
+ extensible, fractured between multiple dialects, and include a bunch
188
+ of device specific stuff that's entirely irrelevant to modern
189
+ publishing tools.
190
+ .
191
+ .P
192
+ Ron aims to address many of the issues with man page creation while
193
+ preserving the things that makes man pages a great form of
194
+ documentation.
195
+ .
196
+ .SH "COPYING"
197
+ Ron is Copyright (C) 2009 \fIRyan Tomayko\fR
198
+ See the file COPYING for information of licensing and distribution.
199
+ .
200
+ .SH "SEE ALSO"
201
+ ron(1), ron(5), markdown(5)
data/man/ron.7.ron ADDED
@@ -0,0 +1,133 @@
1
+ ron -- the opposite of roff
2
+ ===========================
3
+
4
+ ## DESCRIPTION
5
+
6
+ Ron is a humane text format and toolchain for creating UNIX man
7
+ pages, and things that appear as man pages from a distance. Use it
8
+ to build and install standard UNIX roff man pages or to generate
9
+ nicely formatted HTML manual pages for the web.
10
+
11
+ The Ron file format is based on Markdown. In fact, Ron files are a
12
+ compatible subset of Markdown syntax but have a more rigid structure and
13
+ extend Markdown in some ways to provide features commonly found in man
14
+ pages (e.g., definition lists). The ron(5) manual page defines the
15
+ format in more detail.
16
+
17
+ ## DOCUMENTATION
18
+
19
+ The `.ron` files located under the `man/` directory show off a wide
20
+ range of ron capabilities and are the source of Ron's own documentation.
21
+ The source files and generated HTML / roff output files are available
22
+ at:
23
+
24
+ * [ron(1)](http://rtomayko.github.com/ron/ron.1.html) -
25
+ build markdown based manual pages at the command line.
26
+ [source file](http://github.com/rtomayko/ron/blob/master/man/ron.1.ron),
27
+ [roff output](http://github.com/rtomayko/ron/blob/master/man/ron.1)
28
+
29
+ * [ron(5)](http://rtomayko.github.com/ron/ron.5.html) -
30
+ humane manual page authoring format syntax reference.
31
+ [source file](http://github.com/rtomayko/ron/blob/master/man/ron.5.ron),
32
+ [roff output](http://github.com/rtomayko/ron/blob/master/man/ron.5)
33
+
34
+ * [markdown(5)](http://rtomayko.github.com/ron/markdown.5.html) -
35
+ humane text markup syntax (taken from
36
+ [Markdown Syntax](http://daringfireball.net/projects/markdown/syntax),
37
+ John Gruber)
38
+ [source file](http://github.com/rtomayko/ron/blob/master/man/ron.5.ron),
39
+ [roff output](http://github.com/rtomayko/ron/blob/master/man/ron.5)
40
+
41
+ ## INSTALL
42
+
43
+ Install with Rubygems:
44
+
45
+ $ [sudo] gem install ron
46
+ $ ron --help
47
+
48
+ Or, clone the git repository:
49
+
50
+ $ git clone git://github.com/rtomayko/ron.git
51
+ $ PATH=ron/bin:$PATH
52
+ $ ron --help
53
+
54
+ ## BASIC USAGE
55
+
56
+ To generate a roff man page from the included
57
+ [`markdown.5.ron`](man/markdown.5.ron) file and open it with man(1):
58
+
59
+ $ ron -b man/markdown.5.ron
60
+ building: man/markdown.5
61
+ $ man man/markdown.5
62
+
63
+ To generate a standalone HTML version:
64
+
65
+ $ ron -b --html man/markdown.5.ron
66
+ building: man/markdown.5.html
67
+ $ open man/markdown.5.html
68
+
69
+ To build roff and HTML versions of all ron files:
70
+
71
+ $ ron -b --roff --html man/*.ron
72
+
73
+ If you just want to view a ron file as if it were a man page without
74
+ building intermediate files:
75
+
76
+ $ ron -m man/markdown.5.ron
77
+
78
+ The [ron(1)](http://rtomayko.github.com/ron/ron.1.html) manual page
79
+ includes comprehensive documentation on `ron` command line options.
80
+
81
+ ## ABOUT
82
+
83
+ Some people think UNIX manual pages are a poor and outdated style of
84
+ documentation. I disagree:
85
+
86
+ - Man pages follow a well defined structure that's immediately
87
+ familiar and provides a useful starting point for developers
88
+ documenting new tools, libraries, and formats.
89
+
90
+ - Man pages get to the point. Because they're written in an inverted
91
+ style, with a SYNOPSIS section followed by additional detail,
92
+ prose and references to other sources of information, man pages
93
+ provide the best of both cheat sheet and reference style
94
+ documentation.
95
+
96
+ - Man pages have extremely -- unbelievably -- limited text
97
+ formatting capabilities. You get a couple of headings, lists, bold,
98
+ underline and no more. This is a feature.
99
+
100
+ - Although two levels of section hierarchy are technically
101
+ supported, most man pages use only a single level. Unwieldy
102
+ document hierarchies complicate otherwise good documentation.
103
+ Feynman covered all of physics -- heavenly bodies through QED --
104
+ with only two levels of document hierarchy (_The Feynman Lectures
105
+ on Physics_, 1970).
106
+
107
+ - Man pages have a simple referencing syntax; e.g., sh(1), fork(2),
108
+ markdown(5). HTML versions can use this to generate links between
109
+ pages.
110
+
111
+ - The classical terminal man page display is typographically well
112
+ thought out. Big bold section headings, justified monospace text,
113
+ nicely indented paragraphs, intelligently aligned definition
114
+ lists, and an informational header and footer.
115
+
116
+ Unfortunately, trying to figure out how to create a man page is a
117
+ fairly tedious process. The roff/man macro languages are highly
118
+ extensible, fractured between multiple dialects, and include a bunch
119
+ of device specific stuff that's entirely irrelevant to modern
120
+ publishing tools.
121
+
122
+ Ron aims to address many of the issues with man page creation while
123
+ preserving the things that makes man pages a great form of
124
+ documentation.
125
+
126
+ ## COPYING
127
+
128
+ Ron is Copyright (C) 2009 [Ryan Tomayko](http://tomayko.com/about)
129
+ See the file COPYING for information of licensing and distribution.
130
+
131
+ ## SEE ALSO
132
+
133
+ ron(1), ron(5), markdown(5)
data/ron.gemspec CHANGED
@@ -3,8 +3,8 @@ Gem::Specification.new do |s|
3
3
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
4
4
 
5
5
  s.name = 'ron'
6
- s.version = '0.1'
7
- s.date = '2009-11-05'
6
+ s.version = '0.3'
7
+ s.date = '2009-12-09'
8
8
 
9
9
  s.description = "The opposite of roff"
10
10
  s.summary = "The opposite of roff"
@@ -15,27 +15,41 @@ Gem::Specification.new do |s|
15
15
  # = MANIFEST =
16
16
  s.files = %w[
17
17
  COPYING
18
- README
18
+ README.md
19
19
  Rakefile
20
20
  bin/ron
21
21
  lib/ron.rb
22
22
  lib/ron/document.rb
23
23
  lib/ron/layout.html
24
24
  lib/ron/roff.rb
25
+ man/markdown.5
25
26
  man/markdown.5.ron
27
+ man/ron.1
26
28
  man/ron.1.ron
29
+ man/ron.5
27
30
  man/ron.5.ron
31
+ man/ron.7
32
+ man/ron.7.ron
28
33
  ron.gemspec
34
+ test/angle_bracket_syntax.html
35
+ test/angle_bracket_syntax.ron
36
+ test/basic_document.html
37
+ test/basic_document.ron
38
+ test/custom_title_document.html
39
+ test/custom_title_document.ron
40
+ test/definition_list_syntax.html
41
+ test/definition_list_syntax.ron
29
42
  test/document_test.rb
30
43
  test/ron_test.rb
31
- test/simple.ron
44
+ test/titleless_document.html
45
+ test/titleless_document.ron
32
46
  ]
33
47
  # = MANIFEST =
34
48
 
35
49
  s.executables = ['ron']
36
50
  s.test_files = s.files.select { |path| path =~ /^test\/.*_test.rb/ }
37
51
 
38
- s.extra_rdoc_files = %w[README COPYING]
52
+ s.extra_rdoc_files = %w[COPYING]
39
53
  s.add_dependency 'nokogiri', '~> 1.4'
40
54
  s.add_dependency 'rdiscount', '~> 1.3'
41
55
  s.add_development_dependency 'contest', '~> 0.1'
@@ -0,0 +1,12 @@
1
+ <h2 id='NAME'>NAME</h2>
2
+ <p><code>angle_bracket_syntax</code> -- angle bracket syntax test</p>
3
+ <p>A <var>WORD</var> in angle brackets is converted to <var>WORD</var>,</p>
4
+
5
+ <pre><code>except when &lt;WORD&gt; is
6
+ part of a preformatted
7
+ code block,
8
+ </code></pre>
9
+
10
+ <p>or when <code>&lt;WORD&gt;</code> is enclosed in backticks.</p>
11
+
12
+ <p>or when <var>WORD</var> has a &lt;dot.&gt; or &lt;foo:colon&gt;.</p>
@@ -0,0 +1,12 @@
1
+ angle_bracket_syntax(5) -- angle bracket syntax test
2
+ ====================================================
3
+
4
+ A <WORD> in angle brackets is converted to <var>WORD</var>,
5
+
6
+ except when <WORD> is
7
+ part of a preformatted
8
+ code block,
9
+
10
+ or when `<WORD>` is enclosed in backticks.
11
+
12
+ or when <WORD> has a <dot.> or <foo:colon>.
@@ -0,0 +1,3 @@
1
+ <h2 id='NAME'>NAME</h2>
2
+ <p><code>simple</code> -- a simple ron example</p>
3
+ <p>This document created by ron.</p>
@@ -1,2 +1,4 @@
1
1
  simple(7) -- a simple ron example
2
2
  =================================
3
+
4
+ This document created by ron.
@@ -0,0 +1,3 @@
1
+ <h1>custom_title_document -- This is a custom title</h1>
2
+ <p>It doesn't define the name or section of this manual page and is
3
+ output as a simple <code>&lt;h1&gt;</code> instead of a <code>NAME</code> section.</p>
@@ -0,0 +1,5 @@
1
+ This is a custom title
2
+ ======================
3
+
4
+ It doesn't define the name or section of this manual page and is
5
+ output as a simple `<h1>` instead of a `NAME` section.
@@ -0,0 +1,21 @@
1
+ <h2 id='NAME'>NAME</h2>
2
+ <p><code>defition_list_syntax</code> -- hiya</p>
3
+ <p>Definition lists look like unordered lists:</p>
4
+
5
+ <dl>
6
+ <dt class="flush">term</dt>
7
+ <dd><p>definition</p></dd>
8
+ <dt>another one</dt>
9
+ <dd>
10
+ <p>The definition may span
11
+ multiple lines and even</p>
12
+
13
+ <p>start</p>
14
+
15
+ <p>new paragraphs</p>
16
+ </dd>
17
+ <dt>
18
+ <code>--somearg</code>=<var>VALUE</var>
19
+ </dt>
20
+ <dd><p>We can do that too.</p></dd>
21
+ </dl>
@@ -0,0 +1,18 @@
1
+ defition_list_syntax(5) -- hiya
2
+ ===============================
3
+
4
+ Definition lists look like unordered lists:
5
+
6
+ * term:
7
+ definition
8
+
9
+ * another one:
10
+ The definition may span
11
+ multiple lines and even
12
+
13
+ start
14
+
15
+ new paragraphs
16
+
17
+ * `--somearg`=<VALUE>:
18
+ We can do that too.