nronn 0.10.1.pre2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/AUTHORS +8 -0
- data/CHANGES +230 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +72 -0
- data/INSTALLING.md +92 -0
- data/LICENSE.txt +12 -0
- data/README.md +131 -0
- data/Rakefile +153 -0
- data/bin/ronn +253 -0
- data/completion/bash/ronn +32 -0
- data/completion/zsh/_ronn +24 -0
- data/config.ru +15 -0
- data/lib/ronn/document.rb +530 -0
- data/lib/ronn/index.rb +180 -0
- data/lib/ronn/roff.rb +393 -0
- data/lib/ronn/server.rb +67 -0
- data/lib/ronn/template/80c.css +6 -0
- data/lib/ronn/template/dark.css +18 -0
- data/lib/ronn/template/darktoc.css +17 -0
- data/lib/ronn/template/default.html +41 -0
- data/lib/ronn/template/man.css +100 -0
- data/lib/ronn/template/print.css +5 -0
- data/lib/ronn/template/screen.css +105 -0
- data/lib/ronn/template/toc.css +27 -0
- data/lib/ronn/template.rb +173 -0
- data/lib/ronn/utils.rb +57 -0
- data/lib/ronn.rb +47 -0
- data/man/index.html +78 -0
- data/man/index.txt +15 -0
- data/man/ronn-format.7 +145 -0
- data/man/ronn-format.7.ronn +157 -0
- data/man/ronn.1 +227 -0
- data/man/ronn.1.ronn +316 -0
- data/nronn.gemspec +136 -0
- data/test/angle_bracket_syntax.html +27 -0
- data/test/angle_bracket_syntax.roff +24 -0
- data/test/angle_bracket_syntax.ronn +22 -0
- data/test/backticks.html +14 -0
- data/test/backticks.ronn +10 -0
- data/test/basic_document.html +8 -0
- data/test/basic_document.ronn +4 -0
- data/test/circumflexes.ronn +1 -0
- data/test/code_blocks.html +38 -0
- data/test/code_blocks.roff +38 -0
- data/test/code_blocks.ronn +41 -0
- data/test/code_blocks_regression +19 -0
- data/test/code_blocks_regression.html +38 -0
- data/test/code_blocks_regression.ronn +40 -0
- data/test/contest.rb +70 -0
- data/test/custom_title_document.html +6 -0
- data/test/custom_title_document.ronn +5 -0
- data/test/definition_list_syntax.html +25 -0
- data/test/definition_list_syntax.roff +19 -0
- data/test/definition_list_syntax.ronn +18 -0
- data/test/dots_at_line_start_test.roff +19 -0
- data/test/dots_at_line_start_test.ronn +12 -0
- data/test/ellipses.roff +7 -0
- data/test/ellipses.ronn +7 -0
- data/test/entity_encoding_test.html +42 -0
- data/test/entity_encoding_test.roff +51 -0
- data/test/entity_encoding_test.ronn +34 -0
- data/test/index.txt +8 -0
- data/test/markdown_syntax.html +954 -0
- data/test/markdown_syntax.roff +907 -0
- data/test/markdown_syntax.ronn +881 -0
- data/test/middle_paragraph.html +14 -0
- data/test/middle_paragraph.roff +9 -0
- data/test/middle_paragraph.ronn +10 -0
- data/test/missing_spaces.roff +7 -0
- data/test/missing_spaces.ronn +2 -0
- data/test/nested_list.ronn +19 -0
- data/test/nested_list_with_code.html +14 -0
- data/test/nested_list_with_code.roff +11 -0
- data/test/nested_list_with_code.ronn +6 -0
- data/test/ordered_list.html +28 -0
- data/test/ordered_list.roff +25 -0
- data/test/ordered_list.ronn +21 -0
- data/test/page.with.periods.in.name.5.ronn +4 -0
- data/test/pre_block_with_quotes.roff +8 -0
- data/test/pre_block_with_quotes.ronn +6 -0
- data/test/section_reference_links.html +16 -0
- data/test/section_reference_links.roff +7 -0
- data/test/section_reference_links.ronn +12 -0
- data/test/single_quotes.html +11 -0
- data/test/single_quotes.roff +5 -0
- data/test/single_quotes.ronn +9 -0
- data/test/tables.ronn +24 -0
- data/test/test_ronn.rb +124 -0
- data/test/test_ronn_document.rb +186 -0
- data/test/test_ronn_index.rb +73 -0
- data/test/titleless_document.html +9 -0
- data/test/titleless_document.ronn +3 -0
- data/test/underline_spacing_test.roff +13 -0
- data/test/underline_spacing_test.ronn +11 -0
- metadata +309 -0
@@ -0,0 +1,19 @@
|
|
1
|
+
.\" generated with nRonn/v0.9.1
|
2
|
+
.\" https://github.com/n-ronn/nronn/tree/0.9.1
|
3
|
+
.TH "CODE_BLOCKS_REGRESSION" "" "July 2020" ""
|
4
|
+
.SH "In the text:"
|
5
|
+
This is Renzo\'s code\.
|
6
|
+
.P
|
7
|
+
Debian\'s lintian returns the following warning: acute\-accent\-in\-manual\-page
|
8
|
+
.P
|
9
|
+
This manual page uses the \' groff sequence\. Usually, the intent to generate an apostrophe, but that sequence actually renders as a an acute accent\.
|
10
|
+
.P
|
11
|
+
For an apostrophe or a single closing quote, use plain \'\. For single opening quote, i\.e\. a straight downward line \' like the one used in shell commands, use \e(aq\.
|
12
|
+
.SH "Basic code block"
|
13
|
+
The situation is even worse when there are code blocks, mainly code chunks or commands\. E\.g\., copy\-paste fails\.
|
14
|
+
.P
|
15
|
+
Type the following command \fBecho \'Hello World\'\fR\.
|
16
|
+
.P
|
17
|
+
\fBbash $ echo \'hello world\'\fR
|
18
|
+
.P
|
19
|
+
The following code cannot be compiled: \fBC int main() { int example = 42; switch (example) { case \'a\': return 10; default: return 42; } }\fR
|
@@ -0,0 +1,38 @@
|
|
1
|
+
<div class='mp'>
|
2
|
+
|
3
|
+
<h1 id="Example-Quote-Error">Example Quote Error</h1>
|
4
|
+
<h2 id="In-the-text-">In the text:</h2>
|
5
|
+
|
6
|
+
<p>This is Renzo's code.</p>
|
7
|
+
|
8
|
+
<p>Debian's lintian returns the following warning:
|
9
|
+
acute-accent-in-manual-page</p>
|
10
|
+
|
11
|
+
<p>This manual page uses the ' groff sequence. Usually, the intent to
|
12
|
+
generate an apostrophe, but that sequence actually renders as a an acute
|
13
|
+
accent.</p>
|
14
|
+
|
15
|
+
<p>For an apostrophe or a single closing quote, use plain '. For single
|
16
|
+
opening quote, i.e. a straight downward line ' like the one used in
|
17
|
+
shell commands, use \(aq.</p>
|
18
|
+
|
19
|
+
<h2 id="Basic-code-block">Basic code block</h2>
|
20
|
+
|
21
|
+
<p>The situation is even worse when there are code blocks, mainly code
|
22
|
+
chunks or commands. E.g., copy-paste fails.</p>
|
23
|
+
|
24
|
+
<p>Type the following command <code>echo 'Hello World'</code>.</p>
|
25
|
+
|
26
|
+
<pre><code class="language-bash">$ echo 'hello world'
|
27
|
+
</code></pre>
|
28
|
+
|
29
|
+
<p>The following code cannot be compiled:</p>
|
30
|
+
<pre><code class="language-C">int main() {
|
31
|
+
int example = 42;
|
32
|
+
switch (example) {
|
33
|
+
case 'a': return 10;
|
34
|
+
default: return 42;
|
35
|
+
}
|
36
|
+
}
|
37
|
+
</code></pre>
|
38
|
+
</div>
|
@@ -0,0 +1,40 @@
|
|
1
|
+
Example Quote Error
|
2
|
+
===================
|
3
|
+
|
4
|
+
## In the text:
|
5
|
+
|
6
|
+
This is Renzo's code.
|
7
|
+
|
8
|
+
Debian's lintian returns the following warning:
|
9
|
+
acute-accent-in-manual-page
|
10
|
+
|
11
|
+
This manual page uses the \' groff sequence. Usually, the intent to
|
12
|
+
generate an apostrophe, but that sequence actually renders as a an acute
|
13
|
+
accent.
|
14
|
+
|
15
|
+
For an apostrophe or a single closing quote, use plain '. For single
|
16
|
+
opening quote, i.e. a straight downward line ' like the one used in
|
17
|
+
shell commands, use \(aq.
|
18
|
+
|
19
|
+
## Basic code block
|
20
|
+
|
21
|
+
The situation is even worse when there are code blocks, mainly code
|
22
|
+
chunks or commands. E.g., copy-paste fails.
|
23
|
+
|
24
|
+
Type the following command `echo 'Hello World'`.
|
25
|
+
|
26
|
+
``` bash
|
27
|
+
$ echo 'hello world'
|
28
|
+
```
|
29
|
+
|
30
|
+
The following code cannot be compiled:
|
31
|
+
``` C
|
32
|
+
int main() {
|
33
|
+
int example = 42;
|
34
|
+
switch (example) {
|
35
|
+
case 'a': return 10;
|
36
|
+
default: return 42;
|
37
|
+
}
|
38
|
+
}
|
39
|
+
```
|
40
|
+
|
data/test/contest.rb
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
|
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
|
13
|
+
end
|
14
|
+
|
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
|
27
|
+
|
28
|
+
def self.teardown(&block)
|
29
|
+
define_method :teardown do
|
30
|
+
instance_eval(&block)
|
31
|
+
super(&block)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
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
|
41
|
+
|
42
|
+
def self.test(name, &block)
|
43
|
+
define_method(test_name(name), &block)
|
44
|
+
end
|
45
|
+
|
46
|
+
class << self
|
47
|
+
alias should test
|
48
|
+
alias describe context
|
49
|
+
end
|
50
|
+
|
51
|
+
def self.context_name(name)
|
52
|
+
"Test#{sanitize_name(name).gsub(/(^| )(\w)/) { $2.upcase }}".to_sym
|
53
|
+
end
|
54
|
+
|
55
|
+
def self.test_name(name)
|
56
|
+
"test_#{sanitize_name(name).gsub(/\s+/, '_')}".to_sym
|
57
|
+
end
|
58
|
+
|
59
|
+
def self.sanitize_name(name)
|
60
|
+
name.gsub(/\W+/, ' ').strip
|
61
|
+
end
|
62
|
+
|
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
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<div class='mp'>
|
2
|
+
|
3
|
+
<h2 id="NAME">NAME</h2>
|
4
|
+
<p class="man-name">
|
5
|
+
<code>definition_list_syntax</code> - <span class="man-whatis">hiya</span>
|
6
|
+
</p>
|
7
|
+
<p>Definition lists look like unordered lists:</p>
|
8
|
+
|
9
|
+
<dl>
|
10
|
+
<dt>term</dt>
|
11
|
+
<dd>definition</dd>
|
12
|
+
<dt>another one</dt>
|
13
|
+
<dd>The definition may span
|
14
|
+
multiple lines and even
|
15
|
+
|
16
|
+
<p>start</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>
|
24
|
+
</dl>
|
25
|
+
</div>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
.TH "DEFINITION_LIST_SYNTAX" "5" "January 1979" ""
|
2
|
+
.SH "NAME"
|
3
|
+
\fBdefinition_list_syntax\fR \- hiya
|
4
|
+
.P
|
5
|
+
Definition lists look like unordered lists:
|
6
|
+
.TP
|
7
|
+
term
|
8
|
+
definition
|
9
|
+
.TP
|
10
|
+
another one
|
11
|
+
The definition may span multiple lines and even
|
12
|
+
.IP
|
13
|
+
start
|
14
|
+
.IP
|
15
|
+
new paragraphs
|
16
|
+
.TP
|
17
|
+
\fB\-\-somearg\fR=\fIVALUE\fR
|
18
|
+
We can do that too\.
|
19
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
definition_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.
|
@@ -0,0 +1,19 @@
|
|
1
|
+
.TH "DOTS_AT_LINE_START_TEST" "" "January 1979" ""
|
2
|
+
.SH "NAME"
|
3
|
+
\fBdots_at_line_start_test\fR
|
4
|
+
.P
|
5
|
+
There's a weird issue where dots at the beginning of a line generate troff warnings due to escaping\.
|
6
|
+
.P
|
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
|
+
|
@@ -0,0 +1,12 @@
|
|
1
|
+
There's a weird issue where dots at the beginning of a line
|
2
|
+
generate troff warnings due to escaping.
|
3
|
+
|
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
@@ -0,0 +1,42 @@
|
|
1
|
+
<div class='mp'>
|
2
|
+
|
3
|
+
<h2 id="NAME">NAME</h2>
|
4
|
+
<p class="man-name">
|
5
|
+
<code>hello</code> - <span class="man-whatis">hello world</span>
|
6
|
+
</p>
|
7
|
+
<p>Your output <i>might</i> look like this:</p>
|
8
|
+
|
9
|
+
<pre><code>* Chris
|
10
|
+
*
|
11
|
+
* &lt;b&gt;GitHub&lt;/b&gt;
|
12
|
+
* <b>GitHub</b>
|
13
|
+
</code></pre>
|
14
|
+
|
15
|
+
<p>Here's some special entities:</p>
|
16
|
+
|
17
|
+
<ul>
|
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
|
+
</ul>
|
30
|
+
|
31
|
+
<p>Here's a line that uses non-breaking spaces to force the
|
32
|
+
last few words to wrap together.</p>
|
33
|
+
|
34
|
+
<p>And stuff like this:</p>
|
35
|
+
|
36
|
+
<p>git bulk [-g] ([-a]|[-w <ws-name>]) <git command> </git></ws-name><br>
|
37
|
+
git bulk --addworkspace <ws-name> <ws-root-directory> (--from <url or file>) </url></ws-root-directory></ws-name><br>
|
38
|
+
git bulk --removeworkspace <ws-name> <br></p>
|
39
|
+
|
40
|
+
<p>Should have the <code>&lt;</code>/<code>&gt;</code> entities stay as <code>&lt;</code>/<code>&gt;</code> in HTML, but be
|
41
|
+
turned into literal brackets in the ROFF.</p>
|
42
|
+
</div>
|
@@ -0,0 +1,51 @@
|
|
1
|
+
.TH "HELLO" "1" "January 1979" ""
|
2
|
+
.SH "NAME"
|
3
|
+
\fBhello\fR \- hello world
|
4
|
+
.P
|
5
|
+
Your output <i>might</i> look like this:
|
6
|
+
.IP "" 4
|
7
|
+
.nf
|
8
|
+
* Chris
|
9
|
+
*
|
10
|
+
* <b>GitHub</b>
|
11
|
+
* <b>GitHub</b>
|
12
|
+
.fi
|
13
|
+
.IP "" 0
|
14
|
+
.P
|
15
|
+
Here's some special entities:
|
16
|
+
.IP "\(bu" 4
|
17
|
+
• \(bu
|
18
|
+
.IP "\(bu" 4
|
19
|
+
\~
|
20
|
+
.IP "\(bu" 4
|
21
|
+
© \(co
|
22
|
+
.IP "\(bu" 4
|
23
|
+
” \(rs
|
24
|
+
.IP "\(bu" 4
|
25
|
+
— \(em
|
26
|
+
.IP "\(bu" 4
|
27
|
+
® \(rg
|
28
|
+
.IP "\(bu" 4
|
29
|
+
§ \(sc
|
30
|
+
.IP "\(bu" 4
|
31
|
+
≥ \(>=
|
32
|
+
.IP "\(bu" 4
|
33
|
+
≤ \(<=
|
34
|
+
.IP "\(bu" 4
|
35
|
+
≠ \(!=
|
36
|
+
.IP "\(bu" 4
|
37
|
+
≡ \(==
|
38
|
+
.IP "" 0
|
39
|
+
.P
|
40
|
+
Here's a line that uses non\-breaking spaces to force the last\~few\~words\~to\~wrap\~together\.
|
41
|
+
.P
|
42
|
+
And stuff like this:
|
43
|
+
.P
|
44
|
+
git bulk [\-g] ([\-a]|[\-w
|
45
|
+
.br
|
46
|
+
git bulk \-\-addworkspace
|
47
|
+
.br
|
48
|
+
git bulk \-\-removeworkspace <ws\-name>
|
49
|
+
.br
|
50
|
+
.P
|
51
|
+
Should have the \fB<\fR/\fB>\fR entities stay as \fB<\fR/\fB>\fR in HTML, but be turned into literal brackets in the ROFF\.
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# hello(1) -- hello world
|
2
|
+
|
3
|
+
Your output <i>might</i> look like this:
|
4
|
+
|
5
|
+
* Chris
|
6
|
+
*
|
7
|
+
* <b>GitHub</b>
|
8
|
+
* <b>GitHub</b>
|
9
|
+
|
10
|
+
Here's some special entities:
|
11
|
+
|
12
|
+
* &bull; •
|
13
|
+
* &nbsp;
|
14
|
+
* &copy; ©
|
15
|
+
* &rdquo; ”
|
16
|
+
* &mdash; —
|
17
|
+
* &reg; ®
|
18
|
+
* &sect; §
|
19
|
+
* &ge; ≥
|
20
|
+
* &le; ≤
|
21
|
+
* &ne; ≠
|
22
|
+
* &equiv; ≡
|
23
|
+
|
24
|
+
Here's a line that uses non-breaking spaces to force the
|
25
|
+
last few words to wrap together.
|
26
|
+
|
27
|
+
And stuff like this:
|
28
|
+
|
29
|
+
git bulk [-g] ([-a]|[-w <ws-name>]) <git command> <br/>
|
30
|
+
git bulk --addworkspace <ws-name> <ws-root-directory> (--from <URL or file>) <br/>
|
31
|
+
git bulk --removeworkspace <ws-name> <br/>
|
32
|
+
|
33
|
+
Should have the `<`/`>` entities stay as `<`/`>` in HTML, but be
|
34
|
+
turned into literal brackets in the ROFF.
|