kramdown 0.4.0 → 0.5.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.

Files changed (44) hide show
  1. data/ChangeLog +276 -0
  2. data/Rakefile +2 -2
  3. data/VERSION +1 -1
  4. data/benchmark/benchmark.rb +1 -1
  5. data/benchmark/historic-jruby-1.4.0.dat +7 -7
  6. data/benchmark/historic-ruby-1.8.6.dat +7 -7
  7. data/benchmark/historic-ruby-1.8.7.dat +7 -7
  8. data/benchmark/historic-ruby-1.9.1p243.dat +7 -7
  9. data/benchmark/historic-ruby-1.9.2dev.dat +7 -7
  10. data/bin/kramdown +46 -1
  11. data/doc/index.page +2 -2
  12. data/doc/syntax.page +7 -3
  13. data/lib/kramdown/converter.rb +6 -285
  14. data/lib/kramdown/converter/base.rb +75 -0
  15. data/lib/kramdown/converter/html.rb +325 -0
  16. data/lib/kramdown/converter/latex.rb +516 -0
  17. data/lib/kramdown/document.rb +36 -66
  18. data/lib/kramdown/options.rb +262 -0
  19. data/lib/kramdown/parser/kramdown.rb +36 -17
  20. data/lib/kramdown/parser/kramdown/attribute_list.rb +1 -1
  21. data/lib/kramdown/parser/kramdown/autolink.rb +1 -1
  22. data/lib/kramdown/parser/kramdown/codespan.rb +1 -1
  23. data/lib/kramdown/parser/kramdown/emphasis.rb +2 -2
  24. data/lib/kramdown/parser/kramdown/escaped_chars.rb +2 -2
  25. data/lib/kramdown/parser/kramdown/extension.rb +46 -2
  26. data/lib/kramdown/parser/kramdown/footnote.rb +1 -1
  27. data/lib/kramdown/parser/kramdown/html.rb +2 -2
  28. data/lib/kramdown/parser/kramdown/html_entity.rb +4 -5
  29. data/lib/kramdown/parser/kramdown/line_break.rb +1 -1
  30. data/lib/kramdown/parser/kramdown/link.rb +2 -2
  31. data/lib/kramdown/parser/kramdown/smart_quotes.rb +213 -0
  32. data/lib/kramdown/parser/kramdown/typographic_symbol.rb +1 -1
  33. data/lib/kramdown/version.rb +1 -1
  34. data/test/testcases/encoding.html +46 -0
  35. data/test/testcases/encoding.text +28 -0
  36. data/test/testcases/span/01_link/inline.html +1 -1
  37. data/test/testcases/span/01_link/reference.html +2 -2
  38. data/test/testcases/span/escaped_chars/normal.html +4 -0
  39. data/test/testcases/span/escaped_chars/normal.text +4 -0
  40. data/test/testcases/span/text_substitutions/entities.html +1 -1
  41. data/test/testcases/span/text_substitutions/typography.html +12 -0
  42. data/test/testcases/span/text_substitutions/typography.text +12 -0
  43. metadata +9 -3
  44. data/lib/kramdown/extension.rb +0 -98
data/ChangeLog CHANGED
@@ -1,3 +1,279 @@
1
+ commit 53449309c569f774d7d3cd68bcc71d48509a4c7e
2
+ Author: Thomas Leitner <t_leitner@gmx.at>
3
+ Date: Mon Feb 15 10:16:18 2010 +0100
4
+
5
+ Updated benchmark data and graphs
6
+
7
+ benchmark/historic-jruby-1.4.0.dat
8
+ benchmark/historic-ruby-1.8.6.dat
9
+ benchmark/historic-ruby-1.8.7.dat
10
+ benchmark/historic-ruby-1.9.1p243.dat
11
+ benchmark/historic-ruby-1.9.2dev.dat
12
+ doc/img/graph-jruby-1.4.0.png
13
+ doc/img/graph-ruby-1.8.6.png
14
+ doc/img/graph-ruby-1.8.7.png
15
+ doc/img/graph-ruby-1.9.1p243.png
16
+ doc/img/graph-ruby-1.9.2dev.png
17
+
18
+ commit 7422bb09e3df6c98b8d57335e50701bcde2c5f77
19
+ Author: Thomas Leitner <t_leitner@gmx.at>
20
+ Date: Mon Feb 15 10:12:22 2010 +0100
21
+
22
+ Updated release notes
23
+
24
+ doc/index.page
25
+ doc/news/release_0_5_0.page
26
+
27
+ commit 127f5205559a2beac7aae87b6b2ebf203830f68e
28
+ Author: Thomas Leitner <t_leitner@gmx.at>
29
+ Date: Mon Feb 15 10:04:08 2010 +0100
30
+
31
+ Updated kramdown binary so that option descriptions are displayed better
32
+
33
+ bin/kramdown
34
+
35
+ commit d5cdc600c1e559deeac6c333fc8719aed748b1b4
36
+ Author: Thomas Leitner <t_leitner@gmx.at>
37
+ Date: Mon Feb 15 10:03:31 2010 +0100
38
+
39
+ Fixed small problem with parsing of Symbol options
40
+
41
+ lib/kramdown/options.rb
42
+
43
+ commit 366dec49d98245e392a8c472ca62438763b4e36c
44
+ Author: Thomas Leitner <t_leitner@gmx.at>
45
+ Date: Mon Feb 15 10:03:15 2010 +0100
46
+
47
+ Added better option descriptions
48
+
49
+ lib/kramdown/options.rb
50
+
51
+ commit 9dab841f7f75be1b126ff55eedd4b3a8d851b2f8
52
+ Author: Thomas Leitner <t_leitner@gmx.at>
53
+ Date: Sat Feb 13 09:18:19 2010 +0100
54
+
55
+ Added warning output to $stderr for kramdown binary
56
+
57
+ bin/kramdown
58
+
59
+ commit 3f576659ec18548c3ca24923565fbbcf285dadbc
60
+ Author: Thomas Leitner <t_leitner@gmx.at>
61
+ Date: Sat Feb 13 09:18:00 2010 +0100
62
+
63
+ Fixed last remaining issues with LaTeX converter
64
+
65
+ * Local images are now included in the output
66
+ * Entities are correctly converted to their LaTeX equivalent
67
+ * Warnings have been added where approriate
68
+
69
+ data/kramdown/document.latex
70
+ lib/kramdown/converter/base.rb
71
+ lib/kramdown/converter/latex.rb
72
+ lib/kramdown/document.rb
73
+
74
+ commit 5a14647e4f5da8595b61f03c2f80af0fc6d93d5c
75
+ Author: Thomas Leitner <t_leitner@gmx.at>
76
+ Date: Sat Feb 13 09:15:55 2010 +0100
77
+
78
+ Better internal support for HTML entities
79
+
80
+ lib/kramdown/converter/html.rb
81
+ lib/kramdown/parser/kramdown/html_entity.rb
82
+ test/testcases/span/text_substitutions/entities.html
83
+
84
+ commit b94ff3c15d67419f50ea3f4097a44c47f618c7f3
85
+ Author: Thomas Leitner <t_leitner@gmx.at>
86
+ Date: Fri Feb 12 14:05:19 2010 +0100
87
+
88
+ Implemented syntax parsing and conversion support for smart quotes
89
+
90
+ This additional syntax support causes a small performance penalty
91
+ on Ruby 1.8 which is, however, acceptable.
92
+
93
+ doc/syntax.page
94
+ lib/kramdown/converter/html.rb
95
+ lib/kramdown/converter/latex.rb
96
+ lib/kramdown/parser/kramdown.rb
97
+ lib/kramdown/parser/kramdown/escaped_chars.rb
98
+ lib/kramdown/parser/kramdown/smart_quotes.rb
99
+ test/testcases/span/01_link/inline.html
100
+ test/testcases/span/01_link/reference.html
101
+ test/testcases/span/escaped_chars/normal.html
102
+ test/testcases/span/escaped_chars/normal.text
103
+ test/testcases/span/text_substitutions/typography.html
104
+ test/testcases/span/text_substitutions/typography.text
105
+
106
+ commit a7db5ce9d37771b2fcd8ec0ab5e3848e4d6410c4
107
+ Author: Thomas Leitner <t_leitner@gmx.at>
108
+ Date: Fri Feb 12 14:02:38 2010 +0100
109
+
110
+ Fixed bug in benchmark.rb: false date was shown
111
+
112
+ benchmark/benchmark.rb
113
+
114
+ commit 7e91476e1562495daea1d87c90e8195d6f58e59a
115
+ Author: Thomas Leitner <t_leitner@gmx.at>
116
+ Date: Fri Feb 12 12:20:47 2010 +0100
117
+
118
+ Performance optimization in span parser
119
+
120
+ The span parser now uses a much smaller regexp for locating possible span
121
+ elements which leads to better performance.
122
+
123
+ lib/kramdown/parser/kramdown.rb
124
+ lib/kramdown/parser/kramdown/attribute_list.rb
125
+ lib/kramdown/parser/kramdown/autolink.rb
126
+ lib/kramdown/parser/kramdown/codespan.rb
127
+ lib/kramdown/parser/kramdown/emphasis.rb
128
+ lib/kramdown/parser/kramdown/escaped_chars.rb
129
+ lib/kramdown/parser/kramdown/footnote.rb
130
+ lib/kramdown/parser/kramdown/html.rb
131
+ lib/kramdown/parser/kramdown/html_entity.rb
132
+ lib/kramdown/parser/kramdown/line_break.rb
133
+ lib/kramdown/parser/kramdown/link.rb
134
+ lib/kramdown/parser/kramdown/typographic_symbol.rb
135
+
136
+ commit d8d372e894cdf2239d34a58517f918fc983952b3
137
+ Author: Thomas Leitner <t_leitner@gmx.at>
138
+ Date: Thu Feb 11 17:10:21 2010 +0100
139
+
140
+ Fixed Rakefile
141
+
142
+ Rakefile
143
+
144
+ commit f6e878cebd3590a253e1b177610e354e2ab37d28
145
+ Author: Thomas Leitner <t_leitner@gmx.at>
146
+ Date: Wed Feb 10 18:33:04 2010 +0100
147
+
148
+ Added basic support for converting a kramdown document to LaTeX
149
+
150
+ bin/kramdown
151
+ data/kramdown/document.latex
152
+ lib/kramdown/converter.rb
153
+ lib/kramdown/converter/latex.rb
154
+
155
+ commit bb35de9db070ad5e227c0197d71fcda636b76821
156
+ Author: Thomas Leitner <t_leitner@gmx.at>
157
+ Date: Wed Feb 10 18:22:47 2010 +0100
158
+
159
+ Updated converter
160
+
161
+ * Added a base class with common functionality
162
+ * Added support for wrapping the output of a converter in a given ERB template
163
+
164
+ data/kramdown/document.html
165
+ doc/news/release_0_5_0.page
166
+ lib/kramdown/converter.rb
167
+ lib/kramdown/converter/base.rb
168
+ lib/kramdown/converter/html.rb
169
+ lib/kramdown/document.rb
170
+ lib/kramdown/options.rb
171
+
172
+ commit 889bcc99ddae386a4cf6d81f79eb5a46be0e604d
173
+ Author: Thomas Leitner <t_leitner@gmx.at>
174
+ Date: Wed Feb 10 15:31:13 2010 +0100
175
+
176
+ Fixed syntax error
177
+
178
+ doc/syntax.page
179
+
180
+ commit e5ab07d5dbfedb71255c74495643bca5da7cc7d5
181
+ Author: Thomas Leitner <t_leitner@gmx.at>
182
+ Date: Wed Feb 10 15:30:50 2010 +0100
183
+
184
+ Fixed potential future problem with escape regexp in HTML converter
185
+
186
+ lib/kramdown/converter/html.rb
187
+
188
+ commit ab862baa4612736c64b153b9426720ce1c56205a
189
+ Author: Thomas Leitner <t_leitner@gmx.at>
190
+ Date: Mon Feb 8 17:15:11 2010 +0100
191
+
192
+ Enhanced the kramdown binary
193
+
194
+ bin/kramdown
195
+ doc/news/release_0_5_0.page
196
+ lib/kramdown/options.rb
197
+
198
+ commit 38e6052580225bbb42c32499c4c699dac5e0762a
199
+ Author: Thomas Leitner <t_leitner@gmx.at>
200
+ Date: Mon Feb 8 16:56:37 2010 +0100
201
+
202
+ Small API doc update
203
+
204
+ lib/kramdown/converter/html.rb
205
+
206
+ commit 6acf84b84a4eed2706888dd31364dbc5e0ed65be
207
+ Author: Thomas Leitner <t_leitner@gmx.at>
208
+ Date: Mon Feb 8 16:51:24 2010 +0100
209
+
210
+ Implemented better options mechanism
211
+
212
+ Parser/converter options can now be defined easily
213
+
214
+ lib/kramdown/converter/html.rb
215
+ lib/kramdown/document.rb
216
+ lib/kramdown/options.rb
217
+ lib/kramdown/parser/kramdown.rb
218
+ lib/kramdown/parser/kramdown/extension.rb
219
+ lib/kramdown/parser/kramdown/header.rb
220
+ lib/kramdown/parser/kramdown/html.rb
221
+
222
+ commit d2cb1882a9c4e0dd3d094a393c8c37a0631910ac
223
+ Author: Thomas Leitner <t_leitner@gmx.at>
224
+ Date: Fri Feb 5 18:41:09 2010 +0100
225
+
226
+ The quotation mark " is not converted to &quot; in normal text anymore
227
+
228
+ doc/news/release_0_5_0.page
229
+ lib/kramdown/converter/html.rb
230
+ test/testcases/span/01_link/reference.html
231
+
232
+ commit c2e7145bd8fa1723bb97803840f04937c092fd1f
233
+ Author: Thomas Leitner <t_leitner@gmx.at>
234
+ Date: Thu Feb 4 10:03:16 2010 +0100
235
+
236
+ Bumped version number
237
+
238
+ doc/news/release_0_5_0.page
239
+ lib/kramdown/version.rb
240
+
241
+ commit 400283889466d95724eed6169a306d411940bbc8
242
+ Author: Thomas Leitner <t_leitner@gmx.at>
243
+ Date: Thu Feb 4 09:56:54 2010 +0100
244
+
245
+ Code restructurations
246
+
247
+ * Moved default options away from Document into parser and converter classes
248
+ * Moved definition of Extension class to where it belongs, the kramdown parser
249
+ * Moved HTML converter class into lib/kramdown/converter/html.rb
250
+
251
+ lib/kramdown/converter.rb
252
+ lib/kramdown/converter/html.rb
253
+ lib/kramdown/document.rb
254
+ lib/kramdown/extension.rb
255
+ lib/kramdown/parser/kramdown.rb
256
+ lib/kramdown/parser/kramdown/extension.rb
257
+ lib/kramdown/parser/kramdown/header.rb
258
+ lib/kramdown/parser/kramdown/html.rb
259
+
260
+ commit 0ea859157e8f30d488a8e1f78407466c369cc717
261
+ Author: Thomas Leitner <t_leitner@gmx.at>
262
+ Date: Thu Feb 4 09:10:32 2010 +0100
263
+
264
+ Fixed problems with multibyte encodings in Ruby 1.9
265
+
266
+ The StringScanner class returns positions based on bytes and not based on
267
+ characters. Therefore a workaround was needed sothat multibyte encoded
268
+ documents are parsed correctly
269
+
270
+ lib/kramdown/parser/kramdown.rb
271
+ lib/kramdown/parser/kramdown/emphasis.rb
272
+ lib/kramdown/parser/kramdown/html.rb
273
+ lib/kramdown/parser/kramdown/link.rb
274
+ test/testcases/encoding.html
275
+ test/testcases/encoding.text
276
+
1
277
  commit fa3d9d59c3e912a011a26f10a74ee0858cafe4dd
2
278
  Author: Thomas Leitner <t_leitner@gmx.at>
3
279
  Date: Fri Jan 22 17:41:32 2010 +0100
data/Rakefile CHANGED
@@ -216,7 +216,7 @@ EOF
216
216
  # -*- coding: utf-8 -*-
217
217
  #
218
218
  #--
219
- # Copyright (C) 2009 Thomas Leitner <t_leitner@gmx.at>
219
+ # Copyright (C) 2009-2010 Thomas Leitner <t_leitner@gmx.at>
220
220
  #
221
221
  # This file is part of kramdown.
222
222
  #
@@ -258,7 +258,7 @@ task :clobber => ['dev:clobber']
258
258
 
259
259
  module Kramdown
260
260
 
261
- class Extension
261
+ class Parser::Kramdown::Extension
262
262
 
263
263
  def parse_kdexample(parser, opts, body)
264
264
  wrap = Element.new(:html_element, 'div', :attr => {'class' => 'kdexample'})
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.0
1
+ 0.5.0
@@ -18,7 +18,7 @@ RUNS=20
18
18
 
19
19
  FILES=['mdsyntax.text', 'mdbasics.text']
20
20
 
21
- puts "Running tests on #{Time.now.strftime("%Y-%M-%d")} under #{RUBY_DESCRIPTION}"
21
+ puts "Running tests on #{Time.now.strftime("%Y-%m-%d")} under #{RUBY_DESCRIPTION}"
22
22
 
23
23
  FILES.each do |file|
24
24
  data = File.read(File.join(File.dirname(__FILE__), file))
@@ -1,7 +1,7 @@
1
- # kramdown 0.1.0 || kramdown 0.2.0 || kramdown 2009-03-10 || kramdown 2009-11-05 || kramdown 0.3.0 || kramdown 0.4.0
2
- 1 0.21300 0.31800 0.20500 0.24800 0.16800 0.30400
3
- 2 0.20700 0.22600 0.27200 0.22900 0.26700 0.23400
4
- 4 0.22000 0.21700 0.21600 0.19600 0.20400 0.19300
5
- 8 0.36300 0.44500 0.39300 0.34300 0.30100 0.29500
6
- 16 0.45400 0.53400 1.01400 0.41100 0.46200 0.48900
7
- 32 1.02800 0.98100 1.70100 0.84600 0.84600 0.81900
1
+ # kramdown 0.1.0 || kramdown 0.2.0 || kramdown 2009-03-10 || kramdown 2009-11-05 || kramdown 0.3.0 || kramdown 0.4.0 || kramdown 0.5.0
2
+ 1 0.21300 0.31800 0.20500 0.24800 0.16800 0.30400 0.30800
3
+ 2 0.20700 0.22600 0.27200 0.22900 0.26700 0.23400 0.26800
4
+ 4 0.22000 0.21700 0.21600 0.19600 0.20400 0.19300 0.19400
5
+ 8 0.36300 0.44500 0.39300 0.34300 0.30100 0.29500 0.32800
6
+ 16 0.45400 0.53400 1.01400 0.41100 0.46200 0.48900 0.50200
7
+ 32 1.02800 0.98100 1.70100 0.84600 0.84600 0.81900 0.72200
@@ -1,7 +1,7 @@
1
- # kramdown 0.1.0 || kramdown 0.2.0 || kramdown 2009-03-10 || kramdown 2009-11-05 || kramdown 0.3.0 || kramdown 0.4.0
2
- 1 0.01211 0.01274 0.01406 0.01150 0.01385 0.01359
3
- 2 0.02449 0.02582 0.02545 0.02329 0.02924 0.02691
4
- 4 0.08228 0.08475 0.07402 0.07921 0.08600 0.09013
5
- 8 0.12842 0.13410 0.24217 0.12481 0.14426 0.13687
6
- 16 0.22743 0.27748 0.84538 0.21843 0.29497 0.28115
7
- 32 0.45690 0.51838 3.95635 0.51363 0.54252 0.51869
1
+ # kramdown 0.1.0 || kramdown 0.2.0 || kramdown 2009-03-10 || kramdown 2009-11-05 || kramdown 0.3.0 || kramdown 0.4.0 || kramdown 0.5.0
2
+ 1 0.01211 0.01274 0.01406 0.01150 0.01385 0.01359 0.01539
3
+ 2 0.02449 0.02582 0.02545 0.02329 0.02924 0.02691 0.03194
4
+ 4 0.08228 0.08475 0.07402 0.07921 0.08600 0.09013 0.05768
5
+ 8 0.12842 0.13410 0.24217 0.12481 0.14426 0.13687 0.14952
6
+ 16 0.22743 0.27748 0.84538 0.21843 0.29497 0.28115 0.26786
7
+ 32 0.45690 0.51838 3.95635 0.51363 0.54252 0.51869 0.57976
@@ -1,7 +1,7 @@
1
- # kramdown 0.1.0 || kramdown 0.2.0 || kramdown 2009-03-10 || kramdown 2009-11-05 || kramdown 0.3.0 || kramdown 0.4.0
2
- 1 0.01259 0.01329 0.01446 0.01219 0.01580 0.01397
3
- 2 0.02472 0.02672 0.02637 0.02406 0.02858 0.02849
4
- 4 0.09610 0.08355 0.07451 0.07719 0.05439 0.05232
5
- 8 0.13269 0.13811 0.24393 0.12766 0.10869 0.10471
6
- 16 0.27243 0.27540 0.93940 0.25091 0.28680 0.27240
7
- 32 0.52890 0.55667 4.93810 0.50113 0.54547 0.52283
1
+ # kramdown 0.1.0 || kramdown 0.2.0 || kramdown 2009-03-10 || kramdown 2009-11-05 || kramdown 0.3.0 || kramdown 0.4.0 || kramdown 0.5.0
2
+ 1 0.01259 0.01329 0.01446 0.01219 0.01580 0.01397 0.01554
3
+ 2 0.02472 0.02672 0.02637 0.02406 0.02858 0.02849 0.03387
4
+ 4 0.09610 0.08355 0.07451 0.07719 0.05439 0.05232 0.05801
5
+ 8 0.13269 0.13811 0.24393 0.12766 0.10869 0.10471 0.15673
6
+ 16 0.27243 0.27540 0.93940 0.25091 0.28680 0.27240 0.31712
7
+ 32 0.52890 0.55667 4.93810 0.50113 0.54547 0.52283 0.60766
@@ -1,7 +1,7 @@
1
- # kramdown 0.1.0 || kramdown 0.2.0 || kramdown 2009-03-10 || kramdown 2009-11-05 || kramdown 0.3.0 || kramdown 0.4.0
2
- 1 0.02062 0.02216 0.01349 0.02013 0.02152 0.02025
3
- 2 0.04097 0.04290 0.03316 0.03738 0.03939 0.03956
4
- 4 0.07696 0.08015 0.07079 0.07084 0.09122 0.07573
5
- 8 0.16986 0.16998 0.17800 0.14978 0.16856 0.16380
6
- 16 0.33684 0.34800 0.60818 0.30365 0.35242 0.33358
7
- 32 0.68273 0.70498 2.77191 0.61580 0.74138 0.66569
1
+ # kramdown 0.1.0 || kramdown 0.2.0 || kramdown 2009-03-10 || kramdown 2009-11-05 || kramdown 0.3.0 || kramdown 0.4.0 || kramdown 0.5.0
2
+ 1 0.02062 0.02216 0.01349 0.02013 0.02152 0.02025 0.01289
3
+ 2 0.04097 0.04290 0.03316 0.03738 0.03939 0.03956 0.02890
4
+ 4 0.07696 0.08015 0.07079 0.07084 0.09122 0.07573 0.06272
5
+ 8 0.16986 0.16998 0.17800 0.14978 0.16856 0.16380 0.11127
6
+ 16 0.33684 0.34800 0.60818 0.30365 0.35242 0.33358 0.23528
7
+ 32 0.68273 0.70498 2.77191 0.61580 0.74138 0.66569 0.44669
@@ -1,7 +1,7 @@
1
- # kramdown 0.1.0 || kramdown 0.2.0 || kramdown 2009-03-10 || kramdown 2009-11-05 || kramdown 0.3.0 || kramdown 0.4.0
2
- 1 0.01827 0.02000 0.01064 0.01981 0.01830 0.02061
3
- 2 0.03951 0.04158 0.03260 0.03712 0.04056 0.04378
4
- 4 0.08055 0.08419 0.05945 0.07256 0.08363 0.08286
5
- 8 0.14925 0.15101 0.15053 0.14051 0.15830 0.14567
6
- 16 0.31483 0.31485 0.46291 0.28562 0.31176 0.30726
7
- 32 0.62318 0.64162 2.17304 0.56619 0.61918 0.59270
1
+ # kramdown 0.1.0 || kramdown 0.2.0 || kramdown 2009-03-10 || kramdown 2009-11-05 || kramdown 0.3.0 || kramdown 0.4.0 || kramdown 0.5.0
2
+ 1 0.01827 0.02000 0.01064 0.01981 0.01830 0.02061 0.01632
3
+ 2 0.03951 0.04158 0.03260 0.03712 0.04056 0.04378 0.03590
4
+ 4 0.08055 0.08419 0.05945 0.07256 0.08363 0.08286 0.04809
5
+ 8 0.14925 0.15101 0.15053 0.14051 0.15830 0.14567 0.10250
6
+ 16 0.31483 0.31485 0.46291 0.28562 0.31176 0.30726 0.20651
7
+ 32 0.62318 0.64162 2.17304 0.56619 0.61918 0.59270 0.42345
data/bin/kramdown CHANGED
@@ -21,6 +21,51 @@
21
21
  #++
22
22
  #
23
23
 
24
+ require 'optparse'
24
25
  require 'kramdown'
25
26
 
26
- puts Kramdown::Document.new(ARGF.read).to_html
27
+ options = {}
28
+ format = 'html'
29
+ OptionParser.new do |opts|
30
+ opts.banner = "Usage: kramdown [options] [FILE FILE ...]"
31
+ opts.summary_indent = ' '*4
32
+
33
+ opts.separator ""
34
+ opts.separator "Command line options:"
35
+ opts.separator ""
36
+
37
+ opts.on("-f", "--format ARG", "Specify the output format: html (default) or latex") {|v| format = v}
38
+ opts.on("-v", "--version", "Show the version of kramdown") do
39
+ puts Kramdown::VERSION
40
+ exit
41
+ end
42
+ opts.on("-h", "--help", "Show the help") do
43
+ puts opts.summarize('', 5, 72)
44
+ exit
45
+ end
46
+
47
+ opts.separator ""
48
+ opts.separator "kramdown options:"
49
+ opts.separator ""
50
+
51
+ Kramdown::Options.definitions.each do |n, definition|
52
+ if definition.type == Kramdown::Options::Boolean
53
+ opts.on("--[no-]#{n}") {|v| options[n] = Kramdown::Options.parse(n, v)}
54
+ else
55
+ next if definition.type == Object
56
+ type = definition.type
57
+ type = String if type == Symbol
58
+ opts.on("--#{n} ARG", type) {|v| options[n] = Kramdown::Options.parse(n, v)}
59
+ end
60
+
61
+ definition.desc.split(/\n/).each do |line|
62
+ opts.separator opts.summary_indent + ' '*6 + line
63
+ end
64
+ opts.separator ''
65
+ end
66
+
67
+ end.parse!
68
+
69
+ doc = Kramdown::Document.new(ARGF.read, options)
70
+ puts doc.send("to_#{format}")
71
+ doc.warnings.each {|warn| $stderr.puts warn}
data/doc/index.page CHANGED
@@ -79,11 +79,11 @@ and [mailing lists][ml] available if you have any questions!
79
79
  written in Ruby, supports standard Markdown (with some minor modifications) and various extensions
80
80
  that have been made popular by the [PHP Markdown Extra] package and [Maruku].
81
81
 
82
- It is probably the fastest pure-Ruby Markdown converter available (January 2010), being about 4.5x
82
+ It is probably the fastest pure-Ruby Markdown converter available (February 2010), being about 4.5x
83
83
  faster than [Maruku] and about 10x faster than [BlueFeather].
84
84
 
85
85
  <div class="a-center">
86
- The latest version of kramdown is <b>0.4.0</b> and it was released on <b>2010-01-22</b>.
86
+ The latest version of kramdown is <b>0.5.0</b> and it was released on <b>2010-02-15</b>.
87
87
  </div>
88
88
 
89
89
  [PHP Markdown Extra]: http://michelf.com/projects/php-markdown/extra/