nronn 0.10.1.pre2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. checksums.yaml +7 -0
  2. data/AUTHORS +8 -0
  3. data/CHANGES +230 -0
  4. data/Gemfile +2 -0
  5. data/Gemfile.lock +72 -0
  6. data/INSTALLING.md +92 -0
  7. data/LICENSE.txt +12 -0
  8. data/README.md +131 -0
  9. data/Rakefile +153 -0
  10. data/bin/ronn +253 -0
  11. data/completion/bash/ronn +32 -0
  12. data/completion/zsh/_ronn +24 -0
  13. data/config.ru +15 -0
  14. data/lib/ronn/document.rb +530 -0
  15. data/lib/ronn/index.rb +180 -0
  16. data/lib/ronn/roff.rb +393 -0
  17. data/lib/ronn/server.rb +67 -0
  18. data/lib/ronn/template/80c.css +6 -0
  19. data/lib/ronn/template/dark.css +18 -0
  20. data/lib/ronn/template/darktoc.css +17 -0
  21. data/lib/ronn/template/default.html +41 -0
  22. data/lib/ronn/template/man.css +100 -0
  23. data/lib/ronn/template/print.css +5 -0
  24. data/lib/ronn/template/screen.css +105 -0
  25. data/lib/ronn/template/toc.css +27 -0
  26. data/lib/ronn/template.rb +173 -0
  27. data/lib/ronn/utils.rb +57 -0
  28. data/lib/ronn.rb +47 -0
  29. data/man/index.html +78 -0
  30. data/man/index.txt +15 -0
  31. data/man/ronn-format.7 +145 -0
  32. data/man/ronn-format.7.ronn +157 -0
  33. data/man/ronn.1 +227 -0
  34. data/man/ronn.1.ronn +316 -0
  35. data/nronn.gemspec +136 -0
  36. data/test/angle_bracket_syntax.html +27 -0
  37. data/test/angle_bracket_syntax.roff +24 -0
  38. data/test/angle_bracket_syntax.ronn +22 -0
  39. data/test/backticks.html +14 -0
  40. data/test/backticks.ronn +10 -0
  41. data/test/basic_document.html +8 -0
  42. data/test/basic_document.ronn +4 -0
  43. data/test/circumflexes.ronn +1 -0
  44. data/test/code_blocks.html +38 -0
  45. data/test/code_blocks.roff +38 -0
  46. data/test/code_blocks.ronn +41 -0
  47. data/test/code_blocks_regression +19 -0
  48. data/test/code_blocks_regression.html +38 -0
  49. data/test/code_blocks_regression.ronn +40 -0
  50. data/test/contest.rb +70 -0
  51. data/test/custom_title_document.html +6 -0
  52. data/test/custom_title_document.ronn +5 -0
  53. data/test/definition_list_syntax.html +25 -0
  54. data/test/definition_list_syntax.roff +19 -0
  55. data/test/definition_list_syntax.ronn +18 -0
  56. data/test/dots_at_line_start_test.roff +19 -0
  57. data/test/dots_at_line_start_test.ronn +12 -0
  58. data/test/ellipses.roff +7 -0
  59. data/test/ellipses.ronn +7 -0
  60. data/test/entity_encoding_test.html +42 -0
  61. data/test/entity_encoding_test.roff +51 -0
  62. data/test/entity_encoding_test.ronn +34 -0
  63. data/test/index.txt +8 -0
  64. data/test/markdown_syntax.html +954 -0
  65. data/test/markdown_syntax.roff +907 -0
  66. data/test/markdown_syntax.ronn +881 -0
  67. data/test/middle_paragraph.html +14 -0
  68. data/test/middle_paragraph.roff +9 -0
  69. data/test/middle_paragraph.ronn +10 -0
  70. data/test/missing_spaces.roff +7 -0
  71. data/test/missing_spaces.ronn +2 -0
  72. data/test/nested_list.ronn +19 -0
  73. data/test/nested_list_with_code.html +14 -0
  74. data/test/nested_list_with_code.roff +11 -0
  75. data/test/nested_list_with_code.ronn +6 -0
  76. data/test/ordered_list.html +28 -0
  77. data/test/ordered_list.roff +25 -0
  78. data/test/ordered_list.ronn +21 -0
  79. data/test/page.with.periods.in.name.5.ronn +4 -0
  80. data/test/pre_block_with_quotes.roff +8 -0
  81. data/test/pre_block_with_quotes.ronn +6 -0
  82. data/test/section_reference_links.html +16 -0
  83. data/test/section_reference_links.roff +7 -0
  84. data/test/section_reference_links.ronn +12 -0
  85. data/test/single_quotes.html +11 -0
  86. data/test/single_quotes.roff +5 -0
  87. data/test/single_quotes.ronn +9 -0
  88. data/test/tables.ronn +24 -0
  89. data/test/test_ronn.rb +124 -0
  90. data/test/test_ronn_document.rb +186 -0
  91. data/test/test_ronn_index.rb +73 -0
  92. data/test/titleless_document.html +9 -0
  93. data/test/titleless_document.ronn +3 -0
  94. data/test/underline_spacing_test.roff +13 -0
  95. data/test/underline_spacing_test.ronn +11 -0
  96. metadata +309 -0
@@ -0,0 +1,73 @@
1
+ require 'contest'
2
+ require 'ronn'
3
+
4
+ class IndexTest < Test::Unit::TestCase
5
+ setup do
6
+ @index_path = File.expand_path('index.txt', __dir__)
7
+ @missing_path = File.expand_path('missing-index.txt', __dir__)
8
+ end
9
+
10
+ def expand_path(path, rel = File.dirname(__FILE__))
11
+ File.expand_path(path, rel)
12
+ end
13
+
14
+ test 'creating with a non-existent file' do
15
+ index = Ronn::Index.new(@missing_path)
16
+ assert_equal @missing_path, index.path
17
+ assert_equal 0, index.size
18
+ assert index.empty?
19
+ end
20
+
21
+ test 'creating with an index file and no block' do
22
+ index = Ronn::Index.new(@index_path)
23
+ assert_equal 3, index.size
24
+ assert_equal 2, index.manuals.size
25
+
26
+ ref = index.references[0]
27
+ assert_equal 'basic_document(7)', ref.name
28
+ assert_equal 'basic_document.ronn', ref.location
29
+ assert_equal 'basic_document.html', ref.url
30
+ assert_equal expand_path('basic_document.ronn'), ref.path
31
+ assert ref.manual?
32
+ assert ref.ronn?
33
+ assert !ref.remote?
34
+
35
+ ref = index.references[1]
36
+ assert_equal 'definition_list_syntax(5)', ref.name
37
+ assert_equal 'definition_list_syntax.ronn', ref.location
38
+ assert_equal 'definition_list_syntax.html', ref.url
39
+ assert_equal expand_path('definition_list_syntax.ronn'), ref.path
40
+
41
+ ref = index.references[2]
42
+ assert_equal 'grep(1)', ref.name
43
+ assert_equal 'http://man.cx/grep(1)', ref.url
44
+ assert ref.manual?
45
+ assert ref.remote?
46
+ assert !ref.ronn?
47
+ end
48
+
49
+ test 'creating with a block reader' do
50
+ index = Ronn::Index.new(@index_path) { 'hello(1) hello.1.ronn' }
51
+ assert_equal @index_path, index.path
52
+ assert_equal 1, index.size
53
+ ref = index.first
54
+ assert_equal 'hello(1)', ref.name
55
+ assert_equal 'hello.1.ronn', ref.location
56
+ assert_equal 'hello.1.html', ref.url
57
+ assert_equal expand_path('hello.1.ronn'), ref.path
58
+ end
59
+
60
+ test 'adding manual paths' do
61
+ index = Ronn::Index.new(@index_path)
62
+ index << expand_path('angle_bracket_syntax.ronn')
63
+ assert_equal 'angle_bracket_syntax(5)', index.last.name
64
+ assert_equal expand_path('angle_bracket_syntax.ronn'), index.last.path
65
+ end
66
+
67
+ test 'adding manual paths that are already present' do
68
+ index = Ronn::Index.new(@index_path)
69
+ size = index.size
70
+ index << expand_path('basic_document.ronn')
71
+ assert_equal size, index.size
72
+ end
73
+ end
@@ -0,0 +1,9 @@
1
+ <div class='mp'>
2
+ <h2 id="NAME">NAME</h2>
3
+ <p class="man-name">
4
+ <code>titleless_document</code>
5
+ </p>
6
+ <p>This is a document without a level 1 heading. It generates
7
+ a <code>NAME</code> section from the filename but does not include an
8
+ <code>&lt;h1&gt;</code> element.</p>
9
+ </div>
@@ -0,0 +1,3 @@
1
+ This is a document without a level 1 heading. It generates
2
+ a `NAME` section from the filename but does not include an
3
+ `<h1>` element.
@@ -0,0 +1,13 @@
1
+ .TH "UNDERLINE_SPACING_TEST" "" "January 1979" ""
2
+ .SH "NAME"
3
+ \fBunderline_spacing_test\fR
4
+ .P
5
+ This input
6
+ .TP
7
+ \fB\-S\fR \fItext\fR, \fBsearch\fR \fItext\fR
8
+ Performs a substring search of formula names for \fItext\fR\.
9
+ .TP
10
+ \fB\-O\fR \fItext\fR, \fBother\fR \fItext\fR
11
+ Does something else\.
12
+ .P
13
+ Should space text properly\.
@@ -0,0 +1,11 @@
1
+ This input
2
+
3
+ * `-S` _text_, `search` _text_:
4
+ Performs a substring search of formula names for _text_.
5
+
6
+ * `-O` <text>, `other` <text>:
7
+ Does something else.
8
+
9
+ Should space text properly.
10
+
11
+ <!-- this is a comment -->
metadata ADDED
@@ -0,0 +1,309 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: nronn
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.10.1.pre2
5
+ platform: ruby
6
+ authors:
7
+ - Takuya Noguchi
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2022-08-01 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: kramdown
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: kramdown-parser-gfm
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 1.0.1
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 1.0.1
41
+ - !ruby/object:Gem::Dependency
42
+ name: mustache
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: nokogiri
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.11'
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: 1.11.0
65
+ type: :runtime
66
+ prerelease: false
67
+ version_requirements: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - "~>"
70
+ - !ruby/object:Gem::Version
71
+ version: '1.11'
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: 1.11.0
75
+ - !ruby/object:Gem::Dependency
76
+ name: rack
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '2.2'
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: 2.2.3
85
+ type: :development
86
+ prerelease: false
87
+ version_requirements: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - "~>"
90
+ - !ruby/object:Gem::Version
91
+ version: '2.2'
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: 2.2.3
95
+ - !ruby/object:Gem::Dependency
96
+ name: rake
97
+ requirement: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - "~>"
100
+ - !ruby/object:Gem::Version
101
+ version: '12.3'
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: 12.3.3
105
+ type: :development
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - "~>"
110
+ - !ruby/object:Gem::Version
111
+ version: '12.3'
112
+ - - ">="
113
+ - !ruby/object:Gem::Version
114
+ version: 12.3.3
115
+ - !ruby/object:Gem::Dependency
116
+ name: rubocop
117
+ requirement: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - "~>"
120
+ - !ruby/object:Gem::Version
121
+ version: '0.88'
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: 0.88.0
125
+ type: :development
126
+ prerelease: false
127
+ version_requirements: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '0.88'
132
+ - - ">="
133
+ - !ruby/object:Gem::Version
134
+ version: 0.88.0
135
+ - !ruby/object:Gem::Dependency
136
+ name: sinatra
137
+ requirement: !ruby/object:Gem::Requirement
138
+ requirements:
139
+ - - "~>"
140
+ - !ruby/object:Gem::Version
141
+ version: '2.0'
142
+ - - ">="
143
+ - !ruby/object:Gem::Version
144
+ version: 2.0.8
145
+ type: :development
146
+ prerelease: false
147
+ version_requirements: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - "~>"
150
+ - !ruby/object:Gem::Version
151
+ version: '2.0'
152
+ - - ">="
153
+ - !ruby/object:Gem::Version
154
+ version: 2.0.8
155
+ - !ruby/object:Gem::Dependency
156
+ name: test-unit
157
+ requirement: !ruby/object:Gem::Requirement
158
+ requirements:
159
+ - - "~>"
160
+ - !ruby/object:Gem::Version
161
+ version: '3.3'
162
+ - - ">="
163
+ - !ruby/object:Gem::Version
164
+ version: 3.3.6
165
+ type: :development
166
+ prerelease: false
167
+ version_requirements: !ruby/object:Gem::Requirement
168
+ requirements:
169
+ - - "~>"
170
+ - !ruby/object:Gem::Version
171
+ version: '3.3'
172
+ - - ">="
173
+ - !ruby/object:Gem::Version
174
+ version: 3.3.6
175
+ description: nronn builds manuals in HTML and Unix man page format from Markdown.
176
+ email:
177
+ - ''
178
+ executables:
179
+ - ronn
180
+ extensions: []
181
+ extra_rdoc_files:
182
+ - LICENSE.txt
183
+ - AUTHORS
184
+ files:
185
+ - AUTHORS
186
+ - CHANGES
187
+ - Gemfile
188
+ - Gemfile.lock
189
+ - INSTALLING.md
190
+ - LICENSE.txt
191
+ - README.md
192
+ - Rakefile
193
+ - bin/ronn
194
+ - completion/bash/ronn
195
+ - completion/zsh/_ronn
196
+ - config.ru
197
+ - lib/ronn.rb
198
+ - lib/ronn/document.rb
199
+ - lib/ronn/index.rb
200
+ - lib/ronn/roff.rb
201
+ - lib/ronn/server.rb
202
+ - lib/ronn/template.rb
203
+ - lib/ronn/template/80c.css
204
+ - lib/ronn/template/dark.css
205
+ - lib/ronn/template/darktoc.css
206
+ - lib/ronn/template/default.html
207
+ - lib/ronn/template/man.css
208
+ - lib/ronn/template/print.css
209
+ - lib/ronn/template/screen.css
210
+ - lib/ronn/template/toc.css
211
+ - lib/ronn/utils.rb
212
+ - man/index.html
213
+ - man/index.txt
214
+ - man/ronn-format.7
215
+ - man/ronn-format.7.ronn
216
+ - man/ronn.1
217
+ - man/ronn.1.ronn
218
+ - nronn.gemspec
219
+ - test/angle_bracket_syntax.html
220
+ - test/angle_bracket_syntax.roff
221
+ - test/angle_bracket_syntax.ronn
222
+ - test/backticks.html
223
+ - test/backticks.ronn
224
+ - test/basic_document.html
225
+ - test/basic_document.ronn
226
+ - test/circumflexes.ronn
227
+ - test/code_blocks.html
228
+ - test/code_blocks.roff
229
+ - test/code_blocks.ronn
230
+ - test/code_blocks_regression
231
+ - test/code_blocks_regression.html
232
+ - test/code_blocks_regression.ronn
233
+ - test/contest.rb
234
+ - test/custom_title_document.html
235
+ - test/custom_title_document.ronn
236
+ - test/definition_list_syntax.html
237
+ - test/definition_list_syntax.roff
238
+ - test/definition_list_syntax.ronn
239
+ - test/dots_at_line_start_test.roff
240
+ - test/dots_at_line_start_test.ronn
241
+ - test/ellipses.roff
242
+ - test/ellipses.ronn
243
+ - test/entity_encoding_test.html
244
+ - test/entity_encoding_test.roff
245
+ - test/entity_encoding_test.ronn
246
+ - test/index.txt
247
+ - test/markdown_syntax.html
248
+ - test/markdown_syntax.roff
249
+ - test/markdown_syntax.ronn
250
+ - test/middle_paragraph.html
251
+ - test/middle_paragraph.roff
252
+ - test/middle_paragraph.ronn
253
+ - test/missing_spaces.roff
254
+ - test/missing_spaces.ronn
255
+ - test/nested_list.ronn
256
+ - test/nested_list_with_code.html
257
+ - test/nested_list_with_code.roff
258
+ - test/nested_list_with_code.ronn
259
+ - test/ordered_list.html
260
+ - test/ordered_list.roff
261
+ - test/ordered_list.ronn
262
+ - test/page.with.periods.in.name.5.ronn
263
+ - test/pre_block_with_quotes.roff
264
+ - test/pre_block_with_quotes.ronn
265
+ - test/section_reference_links.html
266
+ - test/section_reference_links.roff
267
+ - test/section_reference_links.ronn
268
+ - test/single_quotes.html
269
+ - test/single_quotes.roff
270
+ - test/single_quotes.ronn
271
+ - test/tables.ronn
272
+ - test/test_ronn.rb
273
+ - test/test_ronn_document.rb
274
+ - test/test_ronn_index.rb
275
+ - test/titleless_document.html
276
+ - test/titleless_document.ronn
277
+ - test/underline_spacing_test.roff
278
+ - test/underline_spacing_test.ronn
279
+ homepage: https://github.com/n-ronn/ronn
280
+ licenses:
281
+ - MIT
282
+ metadata:
283
+ bug_tracker_uri: https://github.com/n-ronn/nronn/issues
284
+ source_code_uri: https://github.com/n-ronn/nronn
285
+ changelog_uri: https://github.com/n-ronn/nronn/blob/master/CHANGES
286
+ post_install_message:
287
+ rdoc_options:
288
+ - "--line-numbers"
289
+ - "--inline-source"
290
+ - "--title"
291
+ - Ronn
292
+ require_paths:
293
+ - lib
294
+ required_ruby_version: !ruby/object:Gem::Requirement
295
+ requirements:
296
+ - - ">="
297
+ - !ruby/object:Gem::Version
298
+ version: '2.4'
299
+ required_rubygems_version: !ruby/object:Gem::Requirement
300
+ requirements:
301
+ - - ">"
302
+ - !ruby/object:Gem::Version
303
+ version: 1.3.1
304
+ requirements: []
305
+ rubygems_version: 3.3.19
306
+ signing_key:
307
+ specification_version: 4
308
+ summary: Builds man pages from Markdown
309
+ test_files: []