kramdown 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of kramdown might be problematic. Click here for more details.
- data/ChangeLog +267 -0
- data/VERSION +1 -1
- data/benchmark/benchmark.rb +2 -1
- data/benchmark/generate_data.rb +110 -0
- data/benchmark/historic-jruby-1.4.0.dat +7 -0
- data/benchmark/historic-ruby-1.8.6.dat +7 -0
- data/benchmark/historic-ruby-1.8.7.dat +7 -0
- data/benchmark/historic-ruby-1.9.1p243.dat +7 -0
- data/benchmark/historic-ruby-1.9.2dev.dat +7 -0
- data/benchmark/static-jruby-1.4.0.dat +7 -0
- data/benchmark/static-ruby-1.8.6.dat +7 -0
- data/benchmark/static-ruby-1.8.7.dat +7 -0
- data/benchmark/static-ruby-1.9.1p243.dat +7 -0
- data/benchmark/static-ruby-1.9.2dev.dat +7 -0
- data/benchmark/testing.sh +1 -1
- data/doc/index.page +5 -5
- data/doc/installation.page +3 -3
- data/doc/quickref.page +3 -3
- data/doc/syntax.page +133 -101
- data/doc/tests.page +9 -1
- data/lib/kramdown/compatibility.rb +34 -0
- data/lib/kramdown/converter.rb +26 -8
- data/lib/kramdown/document.rb +2 -1
- data/lib/kramdown/parser.rb +1 -1192
- data/lib/kramdown/parser/kramdown.rb +272 -0
- data/lib/kramdown/parser/kramdown/attribute_list.rb +102 -0
- data/lib/kramdown/parser/kramdown/autolink.rb +42 -0
- data/lib/kramdown/parser/kramdown/blank_line.rb +43 -0
- data/lib/kramdown/parser/kramdown/blockquote.rb +42 -0
- data/lib/kramdown/parser/kramdown/codeblock.rb +62 -0
- data/lib/kramdown/parser/kramdown/codespan.rb +57 -0
- data/lib/kramdown/parser/kramdown/emphasis.rb +69 -0
- data/lib/kramdown/parser/kramdown/eob.rb +39 -0
- data/lib/kramdown/parser/kramdown/escaped_chars.rb +38 -0
- data/lib/kramdown/parser/kramdown/extension.rb +65 -0
- data/lib/kramdown/parser/kramdown/footnote.rb +72 -0
- data/lib/kramdown/parser/kramdown/header.rb +81 -0
- data/lib/kramdown/parser/kramdown/horizontal_rule.rb +39 -0
- data/lib/kramdown/parser/kramdown/html.rb +253 -0
- data/lib/kramdown/{deprecated.rb → parser/kramdown/html_entity.rb} +10 -12
- data/lib/kramdown/parser/kramdown/line_break.rb +38 -0
- data/lib/kramdown/parser/kramdown/link.rb +153 -0
- data/lib/kramdown/parser/kramdown/list.rb +225 -0
- data/lib/kramdown/parser/kramdown/paragraph.rb +44 -0
- data/lib/kramdown/parser/kramdown/typographic_symbol.rb +48 -0
- data/lib/kramdown/version.rb +1 -1
- data/test/testcases/block/09_html/comment.html +1 -0
- data/test/testcases/block/09_html/comment.text +1 -1
- data/test/testcases/block/09_html/content_model/tables.text +2 -2
- data/test/testcases/block/09_html/not_parsed.html +10 -0
- data/test/testcases/block/09_html/not_parsed.text +9 -0
- data/test/testcases/block/09_html/parse_as_raw.html +4 -0
- data/test/testcases/block/09_html/parse_as_raw.text +2 -0
- data/test/testcases/block/09_html/parse_block_html.html +4 -0
- data/test/testcases/block/09_html/parse_block_html.text +3 -0
- data/test/testcases/block/09_html/processing_instruction.html +1 -0
- data/test/testcases/block/09_html/processing_instruction.text +1 -1
- data/test/testcases/block/09_html/simple.html +8 -15
- data/test/testcases/block/09_html/simple.text +2 -12
- data/test/testcases/span/02_emphasis/normal.html +8 -4
- data/test/testcases/span/02_emphasis/normal.text +6 -2
- data/test/testcases/span/05_html/markdown_attr.html +2 -1
- data/test/testcases/span/05_html/markdown_attr.text +2 -1
- data/test/testcases/span/05_html/normal.html +6 -2
- data/test/testcases/span/05_html/normal.text +4 -0
- metadata +35 -4
- data/lib/kramdown/parser/registry.rb +0 -62
data/ChangeLog
CHANGED
@@ -1,3 +1,270 @@
|
|
1
|
+
commit fff933c46a6345aca7ee2333b6c71d9466b0e297
|
2
|
+
Author: Thomas Leitner <t_leitner@gmx.at>
|
3
|
+
Date: Sun Dec 20 16:20:10 2009 +0100
|
4
|
+
|
5
|
+
Small doc update before release
|
6
|
+
|
7
|
+
doc/index.page
|
8
|
+
doc/installation.page
|
9
|
+
|
10
|
+
commit e1e97bcfeea51c1e3fe5afa787132e24d59fd968
|
11
|
+
Author: Thomas Leitner <t_leitner@gmx.at>
|
12
|
+
Date: Sun Dec 20 16:18:54 2009 +0100
|
13
|
+
|
14
|
+
Small display fix
|
15
|
+
|
16
|
+
benchmark/generate_data.rb
|
17
|
+
|
18
|
+
commit d80c3782881777c246e971db4f86c7ff16241c7f
|
19
|
+
Author: Thomas Leitner <t_leitner@gmx.at>
|
20
|
+
Date: Sun Dec 20 16:18:47 2009 +0100
|
21
|
+
|
22
|
+
Added kramdown 0.3.0 data to benchmark and graphs
|
23
|
+
|
24
|
+
benchmark/historic-jruby-1.4.0.dat
|
25
|
+
benchmark/historic-ruby-1.8.6.dat
|
26
|
+
benchmark/historic-ruby-1.8.7.dat
|
27
|
+
benchmark/historic-ruby-1.9.1p243.dat
|
28
|
+
benchmark/historic-ruby-1.9.2dev.dat
|
29
|
+
doc/img/graph-jruby-1.4.0.png
|
30
|
+
doc/img/graph-ruby-1.8.6.png
|
31
|
+
doc/img/graph-ruby-1.8.7.png
|
32
|
+
doc/img/graph-ruby-1.9.1p243.png
|
33
|
+
doc/img/graph-ruby-1.9.2dev.png
|
34
|
+
|
35
|
+
commit 064f97f9bace384a54373f4dca168911dbccf19f
|
36
|
+
Author: Thomas Leitner <t_leitner@gmx.at>
|
37
|
+
Date: Sun Dec 20 15:59:11 2009 +0100
|
38
|
+
|
39
|
+
Updated release notes
|
40
|
+
|
41
|
+
doc/news/release_0_3_0.page
|
42
|
+
|
43
|
+
commit 9041790eb12fedc914d6a9511640e41deeadfcd4
|
44
|
+
Author: Thomas Leitner <t_leitner@gmx.at>
|
45
|
+
Date: Tue Dec 15 08:02:55 2009 +0100
|
46
|
+
|
47
|
+
Updated release notes
|
48
|
+
|
49
|
+
doc/news/release_0_3_0.page
|
50
|
+
|
51
|
+
commit e737974d5cdd9efcf381f3cd1d47809f6a5fbeb2
|
52
|
+
Author: Thomas Leitner <t_leitner@gmx.at>
|
53
|
+
Date: Tue Dec 15 07:59:44 2009 +0100
|
54
|
+
|
55
|
+
Span HTML parser now uses the same semantics for invalid end tags and unclosed tags as block HTML parser
|
56
|
+
|
57
|
+
doc/syntax.page
|
58
|
+
lib/kramdown/parser/kramdown.rb
|
59
|
+
lib/kramdown/parser/kramdown/html.rb
|
60
|
+
test/testcases/span/05_html/normal.html
|
61
|
+
test/testcases/span/05_html/normal.text
|
62
|
+
|
63
|
+
commit cf9330e6f27f21e9a93251d78da61cb8be549671
|
64
|
+
Author: Thomas Leitner <t_leitner@gmx.at>
|
65
|
+
Date: Tue Dec 15 07:35:41 2009 +0100
|
66
|
+
|
67
|
+
Updated release notes
|
68
|
+
|
69
|
+
doc/news/release_0_3_0.page
|
70
|
+
|
71
|
+
commit cd36641782835ddb7f32a0d83131db6193404f5e
|
72
|
+
Author: Thomas Leitner <t_leitner@gmx.at>
|
73
|
+
Date: Tue Dec 15 07:31:11 2009 +0100
|
74
|
+
|
75
|
+
Fixed bug in emphasis parser
|
76
|
+
|
77
|
+
Emphasis started with an underscore at the beginning of a new line inside
|
78
|
+
a paragraph was not recognized.
|
79
|
+
|
80
|
+
lib/kramdown/parser/kramdown/emphasis.rb
|
81
|
+
test/testcases/span/02_emphasis/normal.html
|
82
|
+
test/testcases/span/02_emphasis/normal.text
|
83
|
+
|
84
|
+
commit 59d9be0976970cb33248c81c81d0500c2cfbb4ce
|
85
|
+
Author: Thomas Leitner <t_leitner@gmx.at>
|
86
|
+
Date: Tue Dec 15 07:22:39 2009 +0100
|
87
|
+
|
88
|
+
Small update to the HTML syntax documentation
|
89
|
+
|
90
|
+
doc/syntax.page
|
91
|
+
|
92
|
+
commit ba0d7e1dc9deb8837c95e2f1f9e0f59cdfa93d33
|
93
|
+
Author: Thomas Leitner <t_leitner@gmx.at>
|
94
|
+
Date: Mon Dec 14 10:56:57 2009 +0100
|
95
|
+
|
96
|
+
Fixed some flaws in the HTML parser
|
97
|
+
|
98
|
+
* raw HTML parsing did not work as specified in the syntax documentation
|
99
|
+
* XML comments/PIs now have their own element type
|
100
|
+
* fixed a small problem with autolinks in raw HTML blocks
|
101
|
+
* adjusted parsing of unclosed raw HTML blocks to adhere to syntax documentation
|
102
|
+
|
103
|
+
lib/kramdown/converter.rb
|
104
|
+
lib/kramdown/parser/kramdown.rb
|
105
|
+
lib/kramdown/parser/kramdown/footnote.rb
|
106
|
+
lib/kramdown/parser/kramdown/html.rb
|
107
|
+
test/testcases/block/09_html/not_parsed.html
|
108
|
+
test/testcases/block/09_html/not_parsed.text
|
109
|
+
test/testcases/block/09_html/parse_as_raw.html
|
110
|
+
test/testcases/block/09_html/parse_as_raw.text
|
111
|
+
test/testcases/span/05_html/markdown_attr.html
|
112
|
+
test/testcases/span/05_html/markdown_attr.text
|
113
|
+
|
114
|
+
commit b85972868dd907fd102b665421d51c9bb86c3d86
|
115
|
+
Author: Thomas Leitner <t_leitner@gmx.at>
|
116
|
+
Date: Sun Dec 13 19:42:45 2009 +0100
|
117
|
+
|
118
|
+
Fixed Maruku version number display
|
119
|
+
|
120
|
+
benchmark/benchmark.rb
|
121
|
+
|
122
|
+
commit 94e89b51cf33bae5cee929fa8ce97703f2fee6fc
|
123
|
+
Author: Thomas Leitner <t_leitner@gmx.at>
|
124
|
+
Date: Sun Dec 13 19:42:28 2009 +0100
|
125
|
+
|
126
|
+
Fixed warning on Ruby 1.9
|
127
|
+
|
128
|
+
lib/kramdown/parser/kramdown/list.rb
|
129
|
+
|
130
|
+
commit d3df238aeb533302bafbcc3fe8246dedd74b42f7
|
131
|
+
Author: Thomas Leitner <t_leitner@gmx.at>
|
132
|
+
Date: Sun Dec 13 19:42:04 2009 +0100
|
133
|
+
|
134
|
+
Implemented a new HTML block parser
|
135
|
+
|
136
|
+
The new parser is a little bit more restrictive but the surprise factor
|
137
|
+
for most HTML input should be less than before.
|
138
|
+
|
139
|
+
doc/syntax.page
|
140
|
+
lib/kramdown/converter.rb
|
141
|
+
lib/kramdown/parser/kramdown.rb
|
142
|
+
lib/kramdown/parser/kramdown/html.rb
|
143
|
+
test/testcases/block/09_html/comment.html
|
144
|
+
test/testcases/block/09_html/comment.text
|
145
|
+
test/testcases/block/09_html/content_model/tables.text
|
146
|
+
test/testcases/block/09_html/not_parsed.html
|
147
|
+
test/testcases/block/09_html/not_parsed.text
|
148
|
+
test/testcases/block/09_html/parse_as_raw.html
|
149
|
+
test/testcases/block/09_html/parse_block_html.html
|
150
|
+
test/testcases/block/09_html/parse_block_html.text
|
151
|
+
test/testcases/block/09_html/processing_instruction.html
|
152
|
+
test/testcases/block/09_html/processing_instruction.text
|
153
|
+
test/testcases/block/09_html/simple.html
|
154
|
+
test/testcases/block/09_html/simple.text
|
155
|
+
|
156
|
+
commit cb8333118e7d70719bd25a6ef44c38e98af1d44f
|
157
|
+
Author: Thomas Leitner <t_leitner@gmx.at>
|
158
|
+
Date: Wed Dec 9 14:51:24 2009 +0100
|
159
|
+
|
160
|
+
Added benchmark data and graphs from this data to the tests page
|
161
|
+
|
162
|
+
benchmark/generate_data.rb
|
163
|
+
benchmark/historic-jruby-1.4.0.dat
|
164
|
+
benchmark/historic-ruby-1.8.6.dat
|
165
|
+
benchmark/historic-ruby-1.8.7.dat
|
166
|
+
benchmark/historic-ruby-1.9.1p243.dat
|
167
|
+
benchmark/historic-ruby-1.9.2dev.dat
|
168
|
+
benchmark/static-jruby-1.4.0.dat
|
169
|
+
benchmark/static-ruby-1.8.6.dat
|
170
|
+
benchmark/static-ruby-1.8.7.dat
|
171
|
+
benchmark/static-ruby-1.9.1p243.dat
|
172
|
+
benchmark/static-ruby-1.9.2dev.dat
|
173
|
+
doc/img/graph-jruby-1.4.0.png
|
174
|
+
doc/img/graph-ruby-1.8.6.png
|
175
|
+
doc/img/graph-ruby-1.8.7.png
|
176
|
+
doc/img/graph-ruby-1.9.1p243.png
|
177
|
+
doc/img/graph-ruby-1.9.2dev.png
|
178
|
+
doc/tests.page
|
179
|
+
|
180
|
+
commit 78d9311ef919d9467502f053f416238937fb2746
|
181
|
+
Author: Thomas Leitner <t_leitner@gmx.at>
|
182
|
+
Date: Tue Dec 8 09:45:56 2009 +0100
|
183
|
+
|
184
|
+
Source code restructuration
|
185
|
+
|
186
|
+
* email obfuscation is part of conversion now since it makes more sense there
|
187
|
+
* block parsers can now be enabled/disabled by the parser methods
|
188
|
+
* parsers methods put into various files
|
189
|
+
|
190
|
+
lib/kramdown/converter.rb
|
191
|
+
lib/kramdown/parser.rb
|
192
|
+
lib/kramdown/parser/kramdown.rb
|
193
|
+
lib/kramdown/parser/kramdown/attribute_list.rb
|
194
|
+
lib/kramdown/parser/kramdown/autolink.rb
|
195
|
+
lib/kramdown/parser/kramdown/blank_line.rb
|
196
|
+
lib/kramdown/parser/kramdown/blockquote.rb
|
197
|
+
lib/kramdown/parser/kramdown/codeblock.rb
|
198
|
+
lib/kramdown/parser/kramdown/codespan.rb
|
199
|
+
lib/kramdown/parser/kramdown/emphasis.rb
|
200
|
+
lib/kramdown/parser/kramdown/eob.rb
|
201
|
+
lib/kramdown/parser/kramdown/escaped_chars.rb
|
202
|
+
lib/kramdown/parser/kramdown/extension.rb
|
203
|
+
lib/kramdown/parser/kramdown/footnote.rb
|
204
|
+
lib/kramdown/parser/kramdown/header.rb
|
205
|
+
lib/kramdown/parser/kramdown/horizontal_rule.rb
|
206
|
+
lib/kramdown/parser/kramdown/html.rb
|
207
|
+
lib/kramdown/parser/kramdown/html_entity.rb
|
208
|
+
lib/kramdown/parser/kramdown/line_break.rb
|
209
|
+
lib/kramdown/parser/kramdown/link.rb
|
210
|
+
lib/kramdown/parser/kramdown/list.rb
|
211
|
+
lib/kramdown/parser/kramdown/paragraph.rb
|
212
|
+
lib/kramdown/parser/kramdown/typographic_symbol.rb
|
213
|
+
lib/kramdown/parser/registry.rb
|
214
|
+
|
215
|
+
commit 13c1b5037d5ada5f661dc09ef3f1f18b437ed0f1
|
216
|
+
Author: Thomas Leitner <t_leitner@gmx.at>
|
217
|
+
Date: Tue Dec 8 08:35:32 2009 +0100
|
218
|
+
|
219
|
+
Added note about spelling of kramdown
|
220
|
+
|
221
|
+
doc/index.page
|
222
|
+
|
223
|
+
commit f8f9e65ea3e980286086b7bc25ce6126ea5a2332
|
224
|
+
Author: Thomas Leitner <t_leitner@gmx.at>
|
225
|
+
Date: Fri Dec 4 23:03:15 2009 +0100
|
226
|
+
|
227
|
+
Updated tested platforms and ruby versions
|
228
|
+
|
229
|
+
doc/installation.page
|
230
|
+
|
231
|
+
commit 06d1ff82de3a02c612b912e6384b89feb00a6e0a
|
232
|
+
Author: Thomas Leitner <t_leitner@gmx.at>
|
233
|
+
Date: Fri Dec 4 21:02:03 2009 +0100
|
234
|
+
|
235
|
+
Removed deprecated methods
|
236
|
+
|
237
|
+
lib/kramdown/deprecated.rb
|
238
|
+
lib/kramdown/document.rb
|
239
|
+
|
240
|
+
commit 1591c98a983398b8867c9aaf5151dc3021e2eedf
|
241
|
+
Author: Thomas Leitner <t_leitner@gmx.at>
|
242
|
+
Date: Fri Dec 4 21:00:29 2009 +0100
|
243
|
+
|
244
|
+
Bumped version number and added release notes file
|
245
|
+
|
246
|
+
doc/news/release_0_3_0.page
|
247
|
+
lib/kramdown/version.rb
|
248
|
+
|
249
|
+
commit b93f953c14e8c6c23951e5f78541f5ab69dc2b93
|
250
|
+
Author: Thomas Leitner <t_leitner@gmx.at>
|
251
|
+
Date: Fri Dec 4 20:56:29 2009 +0100
|
252
|
+
|
253
|
+
Added a compatibility fix so that kramdown works under Ruby 1.8.5
|
254
|
+
|
255
|
+
benchmark/testing.sh
|
256
|
+
lib/kramdown/compatibility.rb
|
257
|
+
lib/kramdown/document.rb
|
258
|
+
|
259
|
+
commit 84bbbdd91686ada39b99af5b5cdd61d212065c9a
|
260
|
+
Author: Thomas Leitner <t_leitner@gmx.at>
|
261
|
+
Date: Fri Dec 4 08:13:15 2009 +0100
|
262
|
+
|
263
|
+
Fixed typos in the documentation
|
264
|
+
|
265
|
+
doc/quickref.page
|
266
|
+
doc/syntax.page
|
267
|
+
|
1
268
|
commit 034525fb53f178da9498e0f653c382a17549ca3a
|
2
269
|
Author: Thomas Leitner <t_leitner@gmx.at>
|
3
270
|
Date: Thu Dec 3 20:25:17 2009 +0100
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
data/benchmark/benchmark.rb
CHANGED
@@ -4,6 +4,7 @@ require 'stringio'
|
|
4
4
|
require 'kramdown'
|
5
5
|
require 'bluecloth'
|
6
6
|
require 'maruku'
|
7
|
+
require 'maruku/version'
|
7
8
|
require 'rdiscount'
|
8
9
|
require 'bluefeather'
|
9
10
|
|
@@ -25,7 +26,7 @@ FILES.each do |file|
|
|
25
26
|
puts "Test using file #{file} and #{RUNS} runs"
|
26
27
|
Benchmark.bmbm do |b|
|
27
28
|
b.report("kramdown #{Kramdown::VERSION}") { RUNS.times { Kramdown::Document.new(data).to_html } }
|
28
|
-
b.report("Maruku #{
|
29
|
+
b.report("Maruku #{MaRuKu::Version}") { RUNS.times { Maruku.new(data, :on_error => :ignore).to_html } }
|
29
30
|
b.report("BlueFeather #{BlueFeather::VERSION}") { RUNS.times { BlueFeather.parse(data) } }
|
30
31
|
b.report("BlueCloth #{BlueCloth::VERSION}") { RUNS.times { BlueCloth.new(data).to_html } }
|
31
32
|
b.report("RDiscount #{RDiscount::VERSION}") { RUNS.times { RDiscount.new(data).to_html } }
|
@@ -0,0 +1,110 @@
|
|
1
|
+
require 'benchmark'
|
2
|
+
require 'optparse'
|
3
|
+
require 'fileutils'
|
4
|
+
|
5
|
+
require 'kramdown'
|
6
|
+
require 'maruku'
|
7
|
+
require 'maruku/version'
|
8
|
+
begin
|
9
|
+
require 'rdiscount'
|
10
|
+
require 'bluecloth'
|
11
|
+
rescue LoadError
|
12
|
+
end
|
13
|
+
require 'bluefeather'
|
14
|
+
|
15
|
+
module MaRuKu::Errors
|
16
|
+
def tell_user(s)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
options = {:static => false}
|
21
|
+
OptionParser.new do |opts|
|
22
|
+
opts.on("-s", "--[no-]static", "Generate static data") {|v| options[:static] = v}
|
23
|
+
opts.on("-g", "--[no-]graph", "Generate graph") {|v| options[:graph] = v}
|
24
|
+
opts.on("-h NAME", "--historic NAME", String, "Add historic benchmark data") {|v| options[:historic] = v}
|
25
|
+
end.parse!
|
26
|
+
|
27
|
+
|
28
|
+
THISRUBY = (self.class.const_defined?(:RUBY_DESCRIPTION) ? RUBY_DESCRIPTION.scan(/^.*?(?=\s*\()/).first.sub(/\s/, '-') : "ruby-#{RUBY_VERSION}")
|
29
|
+
|
30
|
+
Dir.chdir(File.dirname(__FILE__))
|
31
|
+
$:.unshift "../lib"
|
32
|
+
BMDATA = File.read('mdbasics.text')
|
33
|
+
MULTIPLIER = (0..5).map {|i| 2**i}
|
34
|
+
|
35
|
+
if options[:static]
|
36
|
+
static = {}
|
37
|
+
2.times do
|
38
|
+
MULTIPLIER.each do |i|
|
39
|
+
$stderr.puts "Generating static benchmark data, multiplier #{i}"
|
40
|
+
mddata = BMDATA*i
|
41
|
+
static[i] = []
|
42
|
+
static[i] << ["Maruku #{MaRuKu::Version}", Benchmark::measure { Maruku.new(mddata, :on_error => :ignore).to_html }.real]
|
43
|
+
static[i] << ["BlueFeather #{BlueFeather::VERSION}", Benchmark::measure { BlueFeather.parse(mddata) }.real]
|
44
|
+
if self.class.const_defined?(:BlueCloth)
|
45
|
+
static[i] << ["BlueCloth #{BlueCloth::VERSION}", Benchmark::measure { BlueCloth.new(mddata).to_html }.real]
|
46
|
+
else
|
47
|
+
static[i] << ["BlueCloth Not Available.", 0]
|
48
|
+
end
|
49
|
+
if self.class.const_defined?(:RDiscount)
|
50
|
+
static[i] << ["RDiscount #{RDiscount::VERSION}", Benchmark::measure { RDiscount.new(mddata).to_html }.real]
|
51
|
+
else
|
52
|
+
static[i] << ["RDiscount Not Available.", 0]
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
File.open("static-#{THISRUBY}.dat", 'w+') do |f|
|
57
|
+
f.puts "# " + static[MULTIPLIER.first].map {|name, val| name }.join(" || ")
|
58
|
+
format_str = "%5d" + " %10.5f"*static[MULTIPLIER.first].size
|
59
|
+
static.sort.each do |m,v|
|
60
|
+
f.puts format_str % [m, *v.map {|name,val| val}]
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
if options[:historic]
|
66
|
+
historic = "historic-#{THISRUBY}.dat"
|
67
|
+
data = if File.exist?(historic)
|
68
|
+
lines = File.readlines(historic).map {|l| l.chomp}
|
69
|
+
lines.first << " || "
|
70
|
+
lines
|
71
|
+
else
|
72
|
+
["# ", *MULTIPLIER.map {|m| "%5d" % m}]
|
73
|
+
end
|
74
|
+
data.first << " #{options[:historic]}"
|
75
|
+
MULTIPLIER.each_with_index do |m, i|
|
76
|
+
$stderr.puts "Generating historic benchmark data, multiplier #{m}"
|
77
|
+
mddata = BMDATA*m
|
78
|
+
Benchmark::measure { Kramdown::Document.new(mddata).to_html }
|
79
|
+
data[i+1] << " %10.5f" % Benchmark::measure { Kramdown::Document.new(mddata).to_html }.real
|
80
|
+
end
|
81
|
+
File.open(historic, 'w+') do |f|
|
82
|
+
data.each {|l| f.puts l}
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
if options[:graph]
|
87
|
+
Dir['historic-*.dat'].each do |historic_name|
|
88
|
+
theruby = historic_name.sub(/^historic-/, '').sub(/\.dat$/, '')
|
89
|
+
graph_name = "graph-#{theruby}.png"
|
90
|
+
static_name = "static-#{theruby}.dat"
|
91
|
+
historic_names = File.readlines(historic_name).first.chomp[1..-1].split(/\s*\|\|\s*/)
|
92
|
+
static_names = (File.exist?(static_name) ? File.readlines(static_name).first.chomp[1..-1].split(/\s*\|\|\s*/) : [])
|
93
|
+
File.open("gnuplot.dat", "w+") do |f|
|
94
|
+
f.puts <<EOF
|
95
|
+
set title "Execution Time Performance for #{theruby}"
|
96
|
+
set xlabel "File Multiplier (i.e. n times mdbasic.text)"
|
97
|
+
set ylabel "Execution Time in secondes"
|
98
|
+
set grid "on"
|
99
|
+
set terminal png
|
100
|
+
set output "#{graph_name}"
|
101
|
+
EOF
|
102
|
+
f.print "plot "
|
103
|
+
i, j = 1, 1
|
104
|
+
f.puts((historic_names.map {|n| i += 1; "\"#{historic_name}\" using 1:#{i} with lp title \"#{n}\""} +
|
105
|
+
static_names.map {|n| j += 1; n =~ /bluefeather/i ? nil : "\"#{static_name}\" using 1:#{j} with lp title \"#{n}\""}.compact).join(", "))
|
106
|
+
end
|
107
|
+
`gnuplot gnuplot.dat`
|
108
|
+
FileUtils.rm("gnuplot.dat")
|
109
|
+
end
|
110
|
+
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# kramdown 0.1.0 || kramdown 0.2.0 || kramdown 2009-03-10 || kramdown 2009-11-05 || kramdown 0.3.0
|
2
|
+
1 0.21300 0.31800 0.20500 0.24800 0.16800
|
3
|
+
2 0.20700 0.22600 0.27200 0.22900 0.26700
|
4
|
+
4 0.22000 0.21700 0.21600 0.19600 0.20400
|
5
|
+
8 0.36300 0.44500 0.39300 0.34300 0.30100
|
6
|
+
16 0.45400 0.53400 1.01400 0.41100 0.46200
|
7
|
+
32 1.02800 0.98100 1.70100 0.84600 0.84600
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# kramdown 0.1.0 || kramdown 0.2.0 || kramdown 2009-03-10 || kramdown 2009-11-05 || kramdown 0.3.0
|
2
|
+
1 0.01211 0.01274 0.01406 0.01150 0.01385
|
3
|
+
2 0.02449 0.02582 0.02545 0.02329 0.02924
|
4
|
+
4 0.08228 0.08475 0.07402 0.07921 0.08600
|
5
|
+
8 0.12842 0.13410 0.24217 0.12481 0.14426
|
6
|
+
16 0.22743 0.27748 0.84538 0.21843 0.29497
|
7
|
+
32 0.45690 0.51838 3.95635 0.51363 0.54252
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# kramdown 0.1.0 || kramdown 0.2.0 || kramdown 2009-03-10 || kramdown 2009-11-05 || kramdown 0.3.0
|
2
|
+
1 0.01259 0.01329 0.01446 0.01219 0.01580
|
3
|
+
2 0.02472 0.02672 0.02637 0.02406 0.02858
|
4
|
+
4 0.09610 0.08355 0.07451 0.07719 0.05439
|
5
|
+
8 0.13269 0.13811 0.24393 0.12766 0.10869
|
6
|
+
16 0.27243 0.27540 0.93940 0.25091 0.28680
|
7
|
+
32 0.52890 0.55667 4.93810 0.50113 0.54547
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# kramdown 0.1.0 || kramdown 0.2.0 || kramdown 2009-03-10 || kramdown 2009-11-05 || kramdown 0.3.0
|
2
|
+
1 0.02062 0.02216 0.01349 0.02013 0.02152
|
3
|
+
2 0.04097 0.04290 0.03316 0.03738 0.03939
|
4
|
+
4 0.07696 0.08015 0.07079 0.07084 0.09122
|
5
|
+
8 0.16986 0.16998 0.17800 0.14978 0.16856
|
6
|
+
16 0.33684 0.34800 0.60818 0.30365 0.35242
|
7
|
+
32 0.68273 0.70498 2.77191 0.61580 0.74138
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# kramdown 0.1.0 || kramdown 0.2.0 || kramdown 2009-03-10 || kramdown 2009-11-05 || kramdown 0.3.0
|
2
|
+
1 0.01827 0.02000 0.01064 0.01981 0.01830
|
3
|
+
2 0.03951 0.04158 0.03260 0.03712 0.04056
|
4
|
+
4 0.08055 0.08419 0.05945 0.07256 0.08363
|
5
|
+
8 0.14925 0.15101 0.15053 0.14051 0.15830
|
6
|
+
16 0.31483 0.31485 0.46291 0.28562 0.31176
|
7
|
+
32 0.62318 0.64162 2.17304 0.56619 0.61918
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# Maruku 0.6.0 || BlueFeather 0.33 || BlueCloth Not Available. || RDiscount Not Available.
|
2
|
+
1 0.07500 0.08500 0.00000 0.00000
|
3
|
+
2 0.14400 0.22800 0.00000 0.00000
|
4
|
+
4 0.28300 0.61100 0.00000 0.00000
|
5
|
+
8 0.62300 1.94700 0.00000 0.00000
|
6
|
+
16 1.30400 7.11800 0.00000 0.00000
|
7
|
+
32 2.56900 28.30800 0.00000 0.00000
|