ronn-ng 0.7.4 → 0.8.0.SNAPSHOT
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.
- checksums.yaml +4 -4
- data/CHANGES +12 -3
- data/Gemfile +2 -0
- data/INSTALLING.md +100 -0
- data/README.md +19 -1
- data/Rakefile +39 -49
- data/bin/ronn +93 -75
- data/completion/bash/ronn +32 -0
- data/completion/zsh/_ronn +24 -0
- data/config.ru +3 -3
- data/lib/ronn/document.rb +127 -106
- data/lib/ronn/index.rb +8 -9
- data/lib/ronn/roff.rb +153 -76
- data/lib/ronn/server.rb +19 -22
- data/lib/ronn/template.rb +27 -26
- data/lib/ronn/utils.rb +9 -7
- data/lib/ronn.rb +5 -3
- data/man/ronn-format.7 +6 -62
- data/man/ronn.1 +21 -123
- data/man/ronn.1.ronn +8 -0
- data/ronn-ng.gemspec +38 -13
- data/test/angle_bracket_syntax.html +4 -5
- data/test/backticks.html +14 -0
- data/test/backticks.ronn +10 -0
- data/test/basic_document.html +3 -4
- data/test/basic_document.ronn +2 -2
- data/test/circumflexes.ronn +1 -0
- data/test/code_blocks.7.ronn +41 -0
- data/test/contest.rb +56 -54
- data/test/custom_title_document.html +2 -2
- data/test/definition_list_syntax.html +13 -9
- data/test/definition_list_syntax.roff +2 -9
- data/test/definition_list_syntax.ronn +2 -2
- data/test/dots_at_line_start_test.roff +12 -3
- data/test/dots_at_line_start_test.ronn +8 -0
- data/test/ellipses.roff +7 -0
- data/test/ellipses.ronn +7 -0
- data/test/entity_encoding_test.html +13 -14
- data/test/entity_encoding_test.roff +1 -22
- data/test/entity_encoding_test.ronn +1 -1
- data/test/markdown_syntax.html +4 -5
- data/test/markdown_syntax.roff +1 -561
- data/test/middle_paragraph.html +2 -3
- data/test/middle_paragraph.roff +1 -5
- data/test/middle_paragraph.ronn +1 -1
- data/test/missing_spaces.roff +0 -2
- data/test/nested_list.ronn +19 -0
- data/test/nested_list_with_code.html +15 -0
- data/test/nested_list_with_code.roff +11 -0
- data/test/nested_list_with_code.ronn +6 -0
- data/test/page.with.periods.in.name.5.ronn +4 -0
- data/test/pre_block_with_quotes.roff +0 -5
- data/test/section_reference_links.html +2 -3
- data/test/section_reference_links.roff +1 -4
- data/test/section_reference_links.ronn +1 -1
- data/test/tables.ronn +24 -0
- data/test/test_ronn.rb +49 -35
- data/test/test_ronn_document.rb +81 -81
- data/test/test_ronn_index.rb +11 -11
- data/test/titleless_document.html +0 -1
- data/test/underline_spacing_test.roff +0 -8
- metadata +140 -22
- data/INSTALLING +0 -20
data/test/backticks.ronn
ADDED
data/test/basic_document.html
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
<div class='mp'>
|
2
|
+
|
2
3
|
<h2 id="NAME">NAME</h2>
|
3
4
|
<p class="man-name">
|
4
|
-
<code>simple</code> - <span class="man-whatis">a simple
|
5
|
+
<code>simple</code> - <span class="man-whatis">a simple ronn example</span>
|
5
6
|
</p>
|
6
|
-
|
7
|
-
<p>This document created by ron.</p>
|
8
|
-
|
7
|
+
<p>This document created by ronn.</p>
|
9
8
|
</div>
|
data/test/basic_document.ronn
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
y = 2^x
|
@@ -0,0 +1,41 @@
|
|
1
|
+
Example Code Blocks
|
2
|
+
===================
|
3
|
+
|
4
|
+
## Basic code block
|
5
|
+
|
6
|
+
```
|
7
|
+
Hello, world!
|
8
|
+
```
|
9
|
+
|
10
|
+
## Language-identified code blocks
|
11
|
+
|
12
|
+
```html
|
13
|
+
<html>
|
14
|
+
<head>
|
15
|
+
<title>Hello, world!</title>
|
16
|
+
</head>
|
17
|
+
<body>
|
18
|
+
Hello, world!
|
19
|
+
</body>
|
20
|
+
</html>
|
21
|
+
```
|
22
|
+
|
23
|
+
## Interspersed code blocks and text
|
24
|
+
|
25
|
+
Some text.
|
26
|
+
|
27
|
+
```
|
28
|
+
Some code.
|
29
|
+
```
|
30
|
+
|
31
|
+
Here's some <pre> text.
|
32
|
+
|
33
|
+
<pre>
|
34
|
+
This is pre text.
|
35
|
+
</pre>
|
36
|
+
|
37
|
+
Some more text.
|
38
|
+
|
39
|
+
```
|
40
|
+
Some more code.
|
41
|
+
```
|
data/test/contest.rb
CHANGED
@@ -1,68 +1,70 @@
|
|
1
|
-
require
|
1
|
+
require 'test/unit'
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
#
|
6
|
-
#
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
# Contest adds +teardown+, +test+ and +context+ as class methods, and the
|
14
|
-
# instance methods +setup+ and +teardown+ now iterate on the corresponding
|
15
|
-
# blocks. Note that all setup and teardown blocks must be defined with the
|
16
|
-
# block syntax. Adding setup or teardown instance methods defeats the purpose
|
17
|
-
# of this library.
|
18
|
-
class Test::Unit::TestCase
|
19
|
-
def self.setup(&block)
|
20
|
-
define_method :setup do
|
21
|
-
super(&block)
|
22
|
-
instance_eval(&block)
|
3
|
+
module Test
|
4
|
+
module Unit
|
5
|
+
# TestSuite loads a default test if the suite is empty, whose purpose is to
|
6
|
+
# fail. Since having empty contexts is a common practice, we decided to
|
7
|
+
# overwrite TestSuite#empty? in order to allow them. Having a failure when no
|
8
|
+
# tests have been defined seems counter-intuitive.
|
9
|
+
class TestSuite
|
10
|
+
def empty?
|
11
|
+
false
|
12
|
+
end
|
23
13
|
end
|
24
|
-
end
|
25
14
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
15
|
+
# Contest adds +teardown+, +test+ and +context+ as class methods, and the
|
16
|
+
# instance methods +setup+ and +teardown+ now iterate on the corresponding
|
17
|
+
# blocks. Note that all setup and teardown blocks must be defined with the
|
18
|
+
# block syntax. Adding setup or teardown instance methods defeats the purpose
|
19
|
+
# of this library.
|
20
|
+
class TestCase
|
21
|
+
def self.setup(&block)
|
22
|
+
define_method :setup do
|
23
|
+
super(&block)
|
24
|
+
instance_eval(&block)
|
25
|
+
end
|
26
|
+
end
|
32
27
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
28
|
+
def self.teardown(&block)
|
29
|
+
define_method :teardown do
|
30
|
+
instance_eval(&block)
|
31
|
+
super(&block)
|
32
|
+
end
|
33
|
+
end
|
39
34
|
|
40
|
-
|
41
|
-
|
42
|
-
|
35
|
+
def self.context(name, &block)
|
36
|
+
subclass = Class.new(self)
|
37
|
+
remove_tests(subclass)
|
38
|
+
subclass.class_eval(&block) if block_given?
|
39
|
+
const_set(context_name(name), subclass)
|
40
|
+
end
|
43
41
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
end
|
42
|
+
def self.test(name, &block)
|
43
|
+
define_method(test_name(name), &block)
|
44
|
+
end
|
48
45
|
|
49
|
-
|
46
|
+
class << self
|
47
|
+
alias should test
|
48
|
+
alias describe context
|
49
|
+
end
|
50
50
|
|
51
|
-
|
52
|
-
|
53
|
-
|
51
|
+
def self.context_name(name)
|
52
|
+
"Test#{sanitize_name(name).gsub(/(^| )(\w)/) { $2.upcase }}".to_sym
|
53
|
+
end
|
54
54
|
|
55
|
-
|
56
|
-
|
57
|
-
|
55
|
+
def self.test_name(name)
|
56
|
+
"test_#{sanitize_name(name).gsub(/\s+/, '_')}".to_sym
|
57
|
+
end
|
58
58
|
|
59
|
-
|
60
|
-
|
61
|
-
|
59
|
+
def self.sanitize_name(name)
|
60
|
+
name.gsub(/\W+/, ' ').strip
|
61
|
+
end
|
62
62
|
|
63
|
-
|
64
|
-
|
65
|
-
|
63
|
+
def self.remove_tests(subclass)
|
64
|
+
subclass.public_instance_methods.grep(/^test_/).each do |meth|
|
65
|
+
subclass.send(:undef_method, meth.to_sym)
|
66
|
+
end
|
67
|
+
end
|
66
68
|
end
|
67
69
|
end
|
68
70
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<div class='mp'>
|
2
|
-
|
2
|
+
|
3
|
+
<h1 id="This-is-a-custom-title">This is a custom title</h1>
|
3
4
|
<p>It doesn't define the name or section of this manual page and is
|
4
5
|
output as a simple <code><h1></code> instead of a <code>NAME</code> section.</p>
|
5
|
-
|
6
6
|
</div>
|
@@ -1,21 +1,25 @@
|
|
1
1
|
<div class='mp'>
|
2
|
+
|
2
3
|
<h2 id="NAME">NAME</h2>
|
3
4
|
<p class="man-name">
|
4
|
-
<code>
|
5
|
+
<code>definition_list_syntax</code> - <span class="man-whatis">hiya</span>
|
5
6
|
</p>
|
6
|
-
|
7
7
|
<p>Definition lists look like unordered lists:</p>
|
8
8
|
|
9
9
|
<dl>
|
10
|
-
<dt
|
11
|
-
<
|
12
|
-
|
10
|
+
<dt>term</dt>
|
11
|
+
<dd>definition</dd>
|
12
|
+
<dt>another one</dt>
|
13
|
+
<dd>The definition may span
|
14
|
+
multiple lines and even
|
13
15
|
|
14
16
|
<p>start</p>
|
15
17
|
|
16
|
-
<p>new paragraphs</p
|
17
|
-
|
18
|
+
<p>new paragraphs</p>
|
19
|
+
</dd>
|
20
|
+
<dt>
|
21
|
+
<code>--somearg</code>=<var>VALUE</var>
|
22
|
+
</dt>
|
23
|
+
<dd>We can do that too.</dd>
|
18
24
|
</dl>
|
19
|
-
|
20
|
-
|
21
25
|
</div>
|
@@ -1,25 +1,18 @@
|
|
1
|
-
.TH "
|
2
|
-
.
|
1
|
+
.TH "DEFINITION_LIST_SYNTAX" "5" "January 1979" "" ""
|
3
2
|
.SH "NAME"
|
4
|
-
\
|
5
|
-
.
|
3
|
+
\fBdefinition_list_syntax\fR \- hiya
|
6
4
|
.P
|
7
5
|
Definition lists look like unordered lists:
|
8
|
-
.
|
9
6
|
.TP
|
10
7
|
term
|
11
8
|
definition
|
12
|
-
.
|
13
9
|
.TP
|
14
10
|
another one
|
15
11
|
The definition may span multiple lines and even
|
16
|
-
.
|
17
12
|
.IP
|
18
13
|
start
|
19
|
-
.
|
20
14
|
.IP
|
21
15
|
new paragraphs
|
22
|
-
.
|
23
16
|
.TP
|
24
17
|
\fB\-\-somearg\fR=\fIVALUE\fR
|
25
18
|
We can do that too\.
|
@@ -1,10 +1,19 @@
|
|
1
1
|
.TH "DOTS_AT_LINE_START_TEST" "" "January 1979" "" ""
|
2
|
-
.
|
3
2
|
.SH "NAME"
|
4
3
|
\fBdots_at_line_start_test\fR
|
5
|
-
.
|
6
4
|
.P
|
7
5
|
There\'s a weird issue where dots at the beginning of a line generate troff warnings due to escaping\.
|
8
|
-
.
|
9
6
|
.P
|
10
7
|
\&\.\. let\'s see what happens\.
|
8
|
+
.IP "" 4
|
9
|
+
.nf
|
10
|
+
\&\. A dot on an indented line
|
11
|
+
|
12
|
+
\&\. Another dot on an indented line
|
13
|
+
|
14
|
+
some text
|
15
|
+
some more text
|
16
|
+
\&\. A dot on an indented line as part of a paragraph
|
17
|
+
.fi
|
18
|
+
.IP "" 0
|
19
|
+
|
@@ -2,3 +2,11 @@ There's a weird issue where dots at the beginning of a line
|
|
2
2
|
generate troff warnings due to escaping.
|
3
3
|
|
4
4
|
.. let's see what happens.
|
5
|
+
|
6
|
+
. A dot on an indented line
|
7
|
+
|
8
|
+
. Another dot on an indented line
|
9
|
+
|
10
|
+
some text
|
11
|
+
some more text
|
12
|
+
. A dot on an indented line as part of a paragraph
|
data/test/ellipses.roff
ADDED
data/test/ellipses.ronn
ADDED
@@ -1,9 +1,9 @@
|
|
1
1
|
<div class='mp'>
|
2
|
+
|
2
3
|
<h2 id="NAME">NAME</h2>
|
3
4
|
<p class="man-name">
|
4
5
|
<code>hello</code> - <span class="man-whatis">hello world</span>
|
5
6
|
</p>
|
6
|
-
|
7
7
|
<p>Your output <i>might</i> look like this:</p>
|
8
8
|
|
9
9
|
<pre><code>* Chris
|
@@ -15,21 +15,20 @@
|
|
15
15
|
<p>Here's some special entities:</p>
|
16
16
|
|
17
17
|
<ul>
|
18
|
-
<li>&bull;
|
19
|
-
<li>&nbsp;
|
20
|
-
<li>&copy;
|
21
|
-
<li>&rdquo;
|
22
|
-
<li>&mdash;
|
23
|
-
<li>&reg;
|
24
|
-
<li>&
|
25
|
-
<li>&ge;
|
26
|
-
<li>&le;
|
27
|
-
<li>&ne;
|
28
|
-
<li>&equiv;
|
18
|
+
<li>&bull; •</li>
|
19
|
+
<li>&nbsp; </li>
|
20
|
+
<li>&copy; ©</li>
|
21
|
+
<li>&rdquo; ”</li>
|
22
|
+
<li>&mdash; —</li>
|
23
|
+
<li>&reg; ®</li>
|
24
|
+
<li>&sect; §</li>
|
25
|
+
<li>&ge; ≥</li>
|
26
|
+
<li>&le; ≤</li>
|
27
|
+
<li>&ne; ≠</li>
|
28
|
+
<li>&equiv; ≡</li>
|
29
29
|
</ul>
|
30
30
|
|
31
31
|
|
32
32
|
<p>Here's a line that uses non-breaking spaces to force the
|
33
|
-
last
|
34
|
-
|
33
|
+
last few words to wrap together.</p>
|
35
34
|
</div>
|
@@ -1,61 +1,40 @@
|
|
1
1
|
.TH "HELLO" "1" "January 1979" "" ""
|
2
|
-
.
|
3
2
|
.SH "NAME"
|
4
3
|
\fBhello\fR \- hello world
|
5
|
-
.
|
6
4
|
.P
|
7
5
|
Your output <i>might</i> look like this:
|
8
|
-
.
|
9
6
|
.IP "" 4
|
10
|
-
.
|
11
7
|
.nf
|
12
|
-
|
13
8
|
* Chris
|
14
9
|
*
|
15
10
|
* <b>GitHub</b>
|
16
11
|
* <b>GitHub</b>
|
17
|
-
.
|
18
12
|
.fi
|
19
|
-
.
|
20
13
|
.IP "" 0
|
21
|
-
.
|
22
14
|
.P
|
23
15
|
Here\'s some special entities:
|
24
|
-
.
|
25
16
|
.IP "\[ci]" 4
|
26
17
|
• \[ci]
|
27
|
-
.
|
28
18
|
.IP "\[ci]" 4
|
29
19
|
\~
|
30
|
-
.
|
31
20
|
.IP "\[ci]" 4
|
32
21
|
© \(co
|
33
|
-
.
|
34
22
|
.IP "\[ci]" 4
|
35
23
|
” \(rs
|
36
|
-
.
|
37
24
|
.IP "\[ci]" 4
|
38
25
|
— \(em
|
39
|
-
.
|
40
26
|
.IP "\[ci]" 4
|
41
27
|
® \(rg
|
42
|
-
.
|
43
28
|
.IP "\[ci]" 4
|
44
|
-
&
|
45
|
-
.
|
29
|
+
§ \(sc
|
46
30
|
.IP "\[ci]" 4
|
47
31
|
≥ \(>=
|
48
|
-
.
|
49
32
|
.IP "\[ci]" 4
|
50
33
|
≤ \(<=
|
51
|
-
.
|
52
34
|
.IP "\[ci]" 4
|
53
35
|
≠ \(!=
|
54
|
-
.
|
55
36
|
.IP "\[ci]" 4
|
56
37
|
≡ \(==
|
57
|
-
.
|
58
38
|
.IP "" 0
|
59
|
-
.
|
60
39
|
.P
|
61
40
|
Here\'s a line that uses non\-breaking spaces to force the last\~few\~words\~to\~wrap\~together\.
|
data/test/markdown_syntax.html
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
<div class='mp'>
|
2
|
+
|
2
3
|
<h2 id="NAME">NAME</h2>
|
3
4
|
<p class="man-name">
|
4
5
|
<code>markdown</code> - <span class="man-whatis">humane markup syntax</span>
|
5
6
|
</p>
|
6
|
-
|
7
7
|
<h2 id="SYNOPSIS">SYNOPSIS</h2>
|
8
8
|
|
9
9
|
<pre><code># Header 1 #
|
@@ -508,7 +508,7 @@ end tell
|
|
508
508
|
<p>A code block continues until it reaches a line that is not indented
|
509
509
|
(or the end of the article).</p>
|
510
510
|
|
511
|
-
<p>Within a code block, ampersands (<code>&</code>) and angle brackets (<code><</code> and <code
|
511
|
+
<p>Within a code block, ampersands (<code>&</code>) and angle brackets (<code><</code> and <code>></code>)
|
512
512
|
are automatically converted into HTML entities. This makes it very
|
513
513
|
easy to include example HTML source code using Markdown -- just paste
|
514
514
|
it and indent it, and Markdown will handle the hassle of encoding the
|
@@ -816,7 +816,7 @@ A backtick-delimited string in a code span: `` `foo` ``
|
|
816
816
|
entities automatically, which makes it easy to include example HTML
|
817
817
|
tags. Markdown will turn this:</p>
|
818
818
|
|
819
|
-
<pre><code>Please don't use any `<blink
|
819
|
+
<pre><code>Please don't use any `<blink>` tags.
|
820
820
|
</code></pre>
|
821
821
|
|
822
822
|
<p>into:</p>
|
@@ -951,7 +951,6 @@ also by John Gruber.</p>
|
|
951
951
|
|
952
952
|
<h2 id="SEE-ALSO">SEE ALSO</h2>
|
953
953
|
|
954
|
-
<p><span class="man-ref">ronn<span class="s">(5)</span></span><br
|
954
|
+
<p><span class="man-ref">ronn<span class="s">(5)</span></span><br>
|
955
955
|
<a href="http://daringfireball.net/projects/markdown/" data-bare-link="true">http://daringfireball.net/projects/markdown/</a></p>
|
956
|
-
|
957
956
|
</div>
|