kramdown 0.14.1 → 0.14.2
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/CONTRIBUTERS +1 -1
- data/ChangeLog +128 -0
- data/Rakefile +5 -72
- data/VERSION +1 -1
- data/benchmark/benchmark.rb +2 -0
- data/doc/default.scss.css +10 -13
- data/doc/default.template +6 -5
- data/doc/design.scss.css +1 -1
- data/doc/documentation.page +6 -0
- data/doc/documentation.template +20 -0
- data/doc/index.page +7 -6
- data/doc/metainfo +3 -0
- data/doc/news.feed +3 -3
- data/doc/news.page +5 -4
- data/doc/options.page +10 -0
- data/doc/quickref.page +8 -6
- data/doc/sidebar.template +2 -2
- data/doc/syntax.page +1 -1
- data/doc/tests.page +48 -11
- data/lib/kramdown/converter/html.rb +43 -25
- data/lib/kramdown/converter/toc.rb +2 -2
- data/lib/kramdown/options.rb +32 -0
- data/lib/kramdown/parser/kramdown.rb +1 -0
- data/lib/kramdown/parser/kramdown/header.rb +5 -3
- data/lib/kramdown/version.rb +1 -1
- data/man/man1/kramdown.1 +16 -0
- data/test/testcases/block/04_header/atx_header.html +6 -0
- data/test/testcases/block/04_header/atx_header.text +7 -0
- data/test/testcases/span/01_link/reference.html +1 -0
- data/test/testcases/span/01_link/reference.html.19 +1 -0
- data/test/testcases/span/01_link/reference.options +3 -0
- data/test/testcases/span/01_link/reference.text +3 -0
- metadata +371 -367
data/CONTRIBUTERS
CHANGED
data/ChangeLog
CHANGED
@@ -1,3 +1,131 @@
|
|
1
|
+
commit 2c5f0da1bd0ef6c91715522dfbe011c84274e627
|
2
|
+
Author: Thomas Leitner <t_leitner@gmx.at>
|
3
|
+
Date: Sun Jan 20 13:55:59 2013 +0100
|
4
|
+
|
5
|
+
Updated release notes, version and homepage.
|
6
|
+
|
7
|
+
doc/default.template
|
8
|
+
doc/img/graph-ruby-1.8.5-231.png
|
9
|
+
doc/img/graph-ruby-1.8.6-399.png
|
10
|
+
doc/img/graph-ruby-1.8.7-249.png
|
11
|
+
doc/img/graph-ruby-1.8.7-302.png
|
12
|
+
doc/img/graph-ruby-1.9.2p136-136.png
|
13
|
+
doc/img/graph-ruby-1.9.3p125-125.png
|
14
|
+
doc/img/graph-ruby-1.9.3p327-327.png
|
15
|
+
doc/img/graph-ruby-2.0.0dev--1.png
|
16
|
+
doc/index.page
|
17
|
+
doc/news/release_0_14_2.page
|
18
|
+
doc/sidebar.template
|
19
|
+
doc/tests.page
|
20
|
+
lib/kramdown/version.rb
|
21
|
+
|
22
|
+
commit 33c6e172569d50f783cc472d4648f089125cfea5
|
23
|
+
Author: Thomas Leitner <t_leitner@gmx.at>
|
24
|
+
Date: Sun Jan 20 12:21:20 2013 +0100
|
25
|
+
|
26
|
+
Added webgen-tmp to gitignore
|
27
|
+
|
28
|
+
.gitignore
|
29
|
+
|
30
|
+
commit a830a73f20c16c97123be54ad8026366aae76f91
|
31
|
+
Author: Thomas Leitner <t_leitner@gmx.at>
|
32
|
+
Date: Sun Jan 20 11:53:53 2013 +0100
|
33
|
+
|
34
|
+
Added new option link_defs for kramdown parser
|
35
|
+
|
36
|
+
This option allows to pre-define link definitions that can be used
|
37
|
+
by reference style links in the document.
|
38
|
+
|
39
|
+
lib/kramdown/options.rb
|
40
|
+
lib/kramdown/parser/kramdown.rb
|
41
|
+
test/testcases/span/01_link/reference.html
|
42
|
+
test/testcases/span/01_link/reference.html.19
|
43
|
+
test/testcases/span/01_link/reference.options
|
44
|
+
test/testcases/span/01_link/reference.text
|
45
|
+
|
46
|
+
commit 24811c707f7c271443936a78a43bc8136df522d9
|
47
|
+
Author: Thomas Leitner <t_leitner@gmx.at>
|
48
|
+
Date: Sun Jan 13 16:27:07 2013 +0100
|
49
|
+
|
50
|
+
Removed unused parameter in Converter::Toc#add_to_toc private method
|
51
|
+
|
52
|
+
lib/kramdown/converter/toc.rb
|
53
|
+
|
54
|
+
commit a81b0b4a1054ff20de73fb9b96769d9ac2317e69
|
55
|
+
Author: Thomas Leitner <t_leitner@gmx.at>
|
56
|
+
Date: Sun Jan 13 16:24:17 2013 +0100
|
57
|
+
|
58
|
+
Updated kramdown website
|
59
|
+
|
60
|
+
* Now using webgen 1.0.0 for generating the site
|
61
|
+
* Added two additional menus to the sidebar for documentation
|
62
|
+
pages to make navigating between pages easier
|
63
|
+
|
64
|
+
Rakefile
|
65
|
+
doc/converter/html.page
|
66
|
+
doc/converter/kramdown.page
|
67
|
+
doc/converter/latex.page
|
68
|
+
doc/converter/remove_html_tags.page
|
69
|
+
doc/default.scss.css
|
70
|
+
doc/default.template
|
71
|
+
doc/documentation.page
|
72
|
+
doc/documentation.template
|
73
|
+
doc/index.page
|
74
|
+
doc/metainfo
|
75
|
+
doc/news.feed
|
76
|
+
doc/news.page
|
77
|
+
doc/options.page
|
78
|
+
doc/parser/html.page
|
79
|
+
doc/parser/kramdown.page
|
80
|
+
doc/quickref.page
|
81
|
+
doc/syntax.page
|
82
|
+
doc/tests.page
|
83
|
+
webgen.config
|
84
|
+
|
85
|
+
commit 68572252546ba3251ae9630a197f94817ddec4c5
|
86
|
+
Author: Thomas Leitner <t_leitner@gmx.at>
|
87
|
+
Date: Sun Jan 13 15:48:27 2013 +0100
|
88
|
+
|
89
|
+
Added Redcarpet to benchmark, benchmark must now be run manually for tests.page
|
90
|
+
|
91
|
+
benchmark/benchmark.rb
|
92
|
+
doc/tests.page
|
93
|
+
|
94
|
+
commit c655bac7f8a26ec43ec5afc3182385245dcdfeb6
|
95
|
+
Author: Thomas Leitner <t_leitner@gmx.at>
|
96
|
+
Date: Sun Jan 13 13:15:03 2013 +0100
|
97
|
+
|
98
|
+
Background of main content now always white regardless of its height
|
99
|
+
|
100
|
+
doc/default.template
|
101
|
+
doc/design.scss.css
|
102
|
+
|
103
|
+
commit 2101d7b8ed8605cad70be804d484c687f9e2ba2a
|
104
|
+
Author: Thomas Leitner <t_leitner@gmx.at>
|
105
|
+
Date: Sun Jan 13 09:12:03 2013 +0100
|
106
|
+
|
107
|
+
Mentioned that the coderay library must be installed for syntax highlighting to work
|
108
|
+
|
109
|
+
doc/converter/html.page
|
110
|
+
|
111
|
+
commit 1db179c7da8a886b8a1004b16b1ff19f4009f26e
|
112
|
+
Author: Thomas Leitner <t_leitner@gmx.at>
|
113
|
+
Date: Sun Jan 13 09:08:56 2013 +0100
|
114
|
+
|
115
|
+
Fixed bug with atx headers without header text
|
116
|
+
|
117
|
+
lib/kramdown/parser/kramdown/header.rb
|
118
|
+
test/testcases/block/04_header/atx_header.html
|
119
|
+
test/testcases/block/04_header/atx_header.text
|
120
|
+
|
121
|
+
commit 836778220d09a21409801b8e60b6645c2d1be94d
|
122
|
+
Author: Thomas Leitner <t_leitner@gmx.at>
|
123
|
+
Date: Sun Jan 13 09:00:13 2013 +0100
|
124
|
+
|
125
|
+
Added helper methods for formatting the elements as HTML tags in HTML converter
|
126
|
+
|
127
|
+
lib/kramdown/converter/html.rb
|
128
|
+
|
1
129
|
commit 5971fc408de5137b38f1ebe95f47f3f6573a86ed
|
2
130
|
Author: Thomas Leitner <t_leitner@gmx.at>
|
3
131
|
Date: Fri Nov 30 18:41:57 2012 +0100
|
data/Rakefile
CHANGED
@@ -8,9 +8,7 @@ rescue LoadError
|
|
8
8
|
end
|
9
9
|
|
10
10
|
begin
|
11
|
-
require 'webgen/webgentask'
|
12
11
|
require 'webgen/page'
|
13
|
-
require 'webgen/website'
|
14
12
|
rescue LoadError
|
15
13
|
end
|
16
14
|
|
@@ -79,26 +77,13 @@ task :clobber do
|
|
79
77
|
ruby "setup.rb clean"
|
80
78
|
end
|
81
79
|
|
82
|
-
|
83
|
-
if defined? Webgen
|
80
|
+
if defined?(Webgen)
|
84
81
|
desc "Generate the HTML documentation"
|
85
|
-
|
86
|
-
|
87
|
-
site.config_block = lambda do |config|
|
88
|
-
config['sources'] = [['/', "Webgen::Source::FileSystem", 'doc']]
|
89
|
-
config['output'] = ['Webgen::Output::FileSystem', 'htmldoc']
|
90
|
-
config.default_processing_pipeline('Page' => 'erb,tags,kramdown,blocks,fragments')
|
91
|
-
config.optionsdisplay.items [], :mandatory => 'default'
|
92
|
-
config.kdlink.oid nil, :mandatory => true
|
93
|
-
config.kdlink.part nil, :mandatory => true
|
94
|
-
config['contentprocessor.tags.map']['options'] = 'OptionsDisplay'
|
95
|
-
config['contentprocessor.tags.map']['kdexample'] = 'KDExample'
|
96
|
-
config['contentprocessor.tags.map']['kdlink'] = 'KDLink'
|
97
|
-
config['contentprocessor.kramdown.options'][:coderay_line_numbers] = nil
|
98
|
-
require 'syck'
|
99
|
-
YAML::ENGINE.yamler = 'syck'
|
100
|
-
end
|
82
|
+
task :htmldoc do
|
83
|
+
ruby "-Ilib -S webgen"
|
101
84
|
end
|
85
|
+
CLOBBER << "htmldoc/"
|
86
|
+
CLOBBER << "webgen-tmp"
|
102
87
|
end
|
103
88
|
|
104
89
|
if defined? RDoc::Task
|
@@ -319,55 +304,3 @@ EOF
|
|
319
304
|
end
|
320
305
|
|
321
306
|
task :clobber => ['dev:clobber']
|
322
|
-
|
323
|
-
# Helper methods and misc ###################################################################
|
324
|
-
|
325
|
-
if defined? Webgen
|
326
|
-
|
327
|
-
class OptionsDisplay
|
328
|
-
|
329
|
-
include Webgen::Tag::Base
|
330
|
-
|
331
|
-
def call(tag, body, context)
|
332
|
-
param('optionsdisplay.items').collect do |opt|
|
333
|
-
Kramdown::Options.definitions[opt]
|
334
|
-
end.collect do |term|
|
335
|
-
lines = term.desc.split(/\n/)
|
336
|
-
first = lines.shift
|
337
|
-
rest = lines[0..-2].collect {|l| " " + l}.join("\n")
|
338
|
-
"`#{term.name}`\n: #{first}\n#{rest}\n\n"
|
339
|
-
end.join("\n")
|
340
|
-
end
|
341
|
-
|
342
|
-
end
|
343
|
-
|
344
|
-
require 'cgi'
|
345
|
-
|
346
|
-
class KDExample
|
347
|
-
|
348
|
-
include Webgen::Tag::Base
|
349
|
-
|
350
|
-
def call(tag, body, context)
|
351
|
-
body.strip!
|
352
|
-
result = ::Kramdown::Document.new(body, :auto_ids => false).to_html
|
353
|
-
before = "<pre class='kdexample-before'><code>#{CGI::escapeHTML(body)}\n</code></pre>"
|
354
|
-
after = "<pre class='kdexample-after-source'><code>#{CGI::escapeHTML(result)}\n</code></pre>"
|
355
|
-
afterhtml = "<div class='kdexample-after-live'>#{result}</div>"
|
356
|
-
|
357
|
-
"<div class='kdexample'>#{before}#{after}#{afterhtml}\n</div><div class='clear'></div>"
|
358
|
-
end
|
359
|
-
|
360
|
-
end
|
361
|
-
|
362
|
-
class KDLink
|
363
|
-
|
364
|
-
include Webgen::Tag::Base
|
365
|
-
|
366
|
-
def call(tag, body, context)
|
367
|
-
link = "<a href='syntax.html##{param('kdlink.oid')}'>→ Syntax for #{param('kdlink.part')}</a>"
|
368
|
-
"<div class='kdsyntaxlink'>#{link}\n</div>"
|
369
|
-
end
|
370
|
-
|
371
|
-
end
|
372
|
-
|
373
|
-
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.14.
|
1
|
+
0.14.2
|
data/benchmark/benchmark.rb
CHANGED
@@ -7,6 +7,7 @@ require 'maruku'
|
|
7
7
|
require 'maruku/version'
|
8
8
|
require 'rdiscount'
|
9
9
|
require 'bluefeather'
|
10
|
+
require 'redcarpet'
|
10
11
|
|
11
12
|
module MaRuKu::Errors
|
12
13
|
def tell_user(s)
|
@@ -30,5 +31,6 @@ FILES.each do |file|
|
|
30
31
|
b.report("BlueFeather #{BlueFeather::VERSION}") { RUNS.times { BlueFeather.parse(data) } }
|
31
32
|
b.report("BlueCloth #{BlueCloth::VERSION}") { RUNS.times { BlueCloth.new(data).to_html } }
|
32
33
|
b.report("RDiscount #{RDiscount::VERSION}") { RUNS.times { RDiscount.new(data).to_html } }
|
34
|
+
b.report("redcarpet #{Redcarpet::VERSION}") { RUNS.times { Redcarpet::Markdown.new(Redcarpet::Render::HTML).render(data) } }
|
33
35
|
end
|
34
36
|
end
|
data/doc/default.scss.css
CHANGED
@@ -81,33 +81,30 @@ aside a {
|
|
81
81
|
opacity: 0;
|
82
82
|
}
|
83
83
|
|
84
|
-
|
85
|
-
|
86
|
-
float: left;
|
87
|
-
margin: 0;
|
84
|
+
table.kdexample td {
|
85
|
+
vertical-align: top;
|
88
86
|
}
|
89
87
|
|
90
|
-
|
88
|
+
table.kdexample pre {
|
89
|
+
margin: 5px 0px;
|
90
|
+
}
|
91
|
+
|
92
|
+
.kdexample:hover .kdexample-after-source {
|
91
93
|
display: block;
|
92
94
|
}
|
93
95
|
|
94
|
-
|
96
|
+
.kdexample-after-source {
|
95
97
|
display: none;
|
96
|
-
width: 45%;
|
97
|
-
float: right;
|
98
98
|
background-color: #ffffee;
|
99
99
|
border: 2px solid #e6e8e9;
|
100
100
|
margin: 0 10px;
|
101
101
|
padding: 5px;
|
102
102
|
}
|
103
103
|
|
104
|
-
|
105
|
-
width: 45%;
|
106
|
-
float: right;
|
107
|
-
clear: none;
|
104
|
+
.kdexample-after-live {
|
108
105
|
background-color: #eeffee;
|
109
106
|
border: 2px solid #e6e8e9;
|
110
|
-
margin:
|
107
|
+
margin: 5px 0px 12px;
|
111
108
|
padding: 5px;
|
112
109
|
}
|
113
110
|
|
data/doc/default.template
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
<head>
|
4
4
|
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
5
5
|
<meta name="author" content="Thomas Leitner" />
|
6
|
-
<meta name="copyright" content="2009-
|
6
|
+
<meta name="copyright" content="2009-2013 Thomas Leitner" />
|
7
7
|
<meta name="description" content="kramdown is a fast, pure-Ruby Markdown-superset converter" />
|
8
8
|
<meta name="keywords" content="ruby, kramdown, markdown, text markup" />
|
9
9
|
<link href="{relocatable: default.css}" type="text/css" rel="stylesheet" media="screen,projection" />
|
@@ -19,12 +19,12 @@
|
|
19
19
|
</hgroup>
|
20
20
|
|
21
21
|
<nav>
|
22
|
-
{menu: {
|
22
|
+
{menu: {options: {mi: {in_menu: true}, sort: sort_info, flatten: true}}}
|
23
23
|
</nav>
|
24
24
|
</header>
|
25
25
|
|
26
26
|
<div id="wrapper">
|
27
|
-
<% if context.content_node.
|
27
|
+
<% if context.content_node.blocks.has_key?('intro') %>
|
28
28
|
<aside class="banner">
|
29
29
|
<webgen:block name="intro" node="first" />
|
30
30
|
</aside>
|
@@ -37,12 +37,13 @@
|
|
37
37
|
</aside>
|
38
38
|
|
39
39
|
<div id="content">
|
40
|
-
<webgen:block name="content" />
|
40
|
+
<webgen:block name="content" node="first" />
|
41
41
|
</div>
|
42
|
+
<div style="clear:both"></div>
|
42
43
|
</div>
|
43
44
|
|
44
45
|
<footer>
|
45
|
-
<div class="float-left">Copyright © 2009-
|
46
|
+
<div class="float-left">Copyright © 2009-2013 Thomas Leitner</div>
|
46
47
|
<div class="float-right">Generated by <a href="http://webgen.rubyforge.org">webgen</a></div>
|
47
48
|
</footer>
|
48
49
|
|
data/doc/design.scss.css
CHANGED
data/doc/documentation.page
CHANGED
@@ -3,6 +3,8 @@ title: Documentation
|
|
3
3
|
in_menu: true
|
4
4
|
sort_info: 7
|
5
5
|
---
|
6
|
+
# kramdown Documentation
|
7
|
+
|
6
8
|
## Overview
|
7
9
|
|
8
10
|
kramdown is first and foremost a library for converting text written in a superset of Markdown to
|
@@ -20,6 +22,10 @@ formats. The following input and output formats are currently supported:
|
|
20
22
|
The [kramdown syntax page](syntax.html) describes in detail what is supported and how it differs
|
21
23
|
from standard Markdown.
|
22
24
|
|
25
|
+
For all available options have a look at the [options documentation](options.html) or have a look at
|
26
|
+
a parser/converter page to see which options they support!
|
27
|
+
|
28
|
+
|
23
29
|
## Usage
|
24
30
|
|
25
31
|
{:ruby: .language-ruby}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
--- name:sidebar pipeline:erb,tags,kramdown
|
2
|
+
<h1>Documentation</h1>
|
3
|
+
|
4
|
+
* Parsers
|
5
|
+
* [kramdown](parser/kramdown.html)
|
6
|
+
* [Markdown](parser/markdown.html)
|
7
|
+
* [HTML](parser/html.html)
|
8
|
+
* Converters
|
9
|
+
* [HTML](converter/html.html)
|
10
|
+
* [LaTeX](converter/latex.html)
|
11
|
+
* [kramdown](converter/kramdown.html)
|
12
|
+
* [RemoveHtmlTags](converter/remove_html_tags.html)
|
13
|
+
* [Configuration Options](options.html)
|
14
|
+
* [Tests](tests.html)
|
15
|
+
|
16
|
+
<% if context.node.children.first && context.node.children.first.children.length > 1 %>
|
17
|
+
<h1>Contents</h1>
|
18
|
+
<% end %>
|
19
|
+
|
20
|
+
{menu: {options: {descendants: true, levels: [3,6]}}}
|
data/doc/index.page
CHANGED
@@ -12,12 +12,13 @@ its parsers/converters. The [quick reference](quickref.html) provides a overview
|
|
12
12
|
you need a more detailed description of the superset of Markdown which kramdown supports the [syntax
|
13
13
|
page](syntax.html) is the place to go!
|
14
14
|
|
15
|
-
{tikz::
|
15
|
+
{tikz::
|
16
|
+
path: overview.png
|
16
17
|
img_attr: {style: 'background:transparent'}
|
17
|
-
libraries: [mindmap, trees, arrows]
|
18
|
-
transparent: true
|
19
|
-
resolution: 300 100
|
20
|
-
opts: |
|
18
|
+
content_processor.tikz.libraries: [mindmap, trees, arrows]
|
19
|
+
content_processor.tikz.transparent: true
|
20
|
+
content_processor.tikz.resolution: 300 100
|
21
|
+
content_processor.tikz.opts: |
|
21
22
|
mindmap, concept color=black, text=white,
|
22
23
|
root concept/.append style={font=\Large},
|
23
24
|
level 1 concept/.append style={font=\Large, minimum size=2.6cm},
|
@@ -85,7 +86,7 @@ Markdown implementations because kramdown borrowed many ideas from existing pack
|
|
85
86
|
completely written in Ruby, supports standard Markdown (with some minor modifications) and various
|
86
87
|
extensions that have been made popular by the [PHP Markdown Extra] package and [Maruku].
|
87
88
|
|
88
|
-
It is probably the fastest pure-Ruby Markdown converter available (
|
89
|
+
It is probably the fastest pure-Ruby Markdown converter available (January 2013), being about 4x
|
89
90
|
faster than [Maruku] and about 5x faster than [BlueFeather].
|
90
91
|
|
91
92
|
[PHP Markdown Extra]: http://michelf.com/projects/php-markdown/extra/
|
data/doc/metainfo
ADDED
data/doc/news.feed
CHANGED
@@ -4,7 +4,7 @@ description: kramdown - a fast, pure Ruby Markdown-superset converter
|
|
4
4
|
site_url: http://kramdown.rubyforge.org/
|
5
5
|
author: Thomas Leitner
|
6
6
|
author_url: http://kramdown.rubyforge.org
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
entries: {alcn: news/*.html, sort: sort_info, reverse: true, limit: 10}
|
8
|
+
versions:
|
9
|
+
atom:
|
10
10
|
|
data/doc/news.page
CHANGED
@@ -12,10 +12,11 @@ sort_info: 30
|
|
12
12
|
|
13
13
|
--- name:newsdata pipeline:erb
|
14
14
|
<%
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
opts = {:alcn => '/news/*.html', :sort => 'sort_info', :reverse => true, :flatten => true}
|
16
|
+
context.website.ext.item_tracker.add(context.dest_node, :nodes, :node_finder_option_set,
|
17
|
+
{:opts => opts, :ref_alcn => context.node.alcn}, :content)
|
18
|
+
context.website.ext.node_finder.find(opts, context.node).each do |node|
|
19
|
+
# context.options['contentprocessor.kramdown.options'] = {:auto_id_prefix => node.lcn.tr('.', '-')}
|
19
20
|
%>
|
20
21
|
|
21
22
|
<div class='news-item'>
|