radiant-kramdown_filter-extension 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/kramdown_filter_extension.rb +2 -2
- data/lib/kramdown_filter.rb +7 -1
- data/markdown.html +120 -0
- metadata +4 -3
@@ -4,9 +4,9 @@ end
|
|
4
4
|
require 'kramdown'
|
5
5
|
|
6
6
|
class KramdownFilterExtension < Radiant::Extension
|
7
|
-
version "1.0"
|
7
|
+
version "1.0.2"
|
8
8
|
description "kramdown is a fast pure-Ruby Markdown converter."
|
9
|
-
url "http://
|
9
|
+
url "http://github.com/johnmuhl/radiant-kramdown_filter-extension"
|
10
10
|
|
11
11
|
def activate
|
12
12
|
KramdownFilter
|
data/lib/kramdown_filter.rb
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
class KramdownFilter < TextFilter
|
2
|
+
unloadable
|
2
3
|
description_file File.dirname(__FILE__) + "/../markdown.html"
|
3
4
|
def filter(text)
|
4
|
-
|
5
|
+
auto_ids = true if Radiant::Config['kramdown_auto_ids'] == 'true'
|
6
|
+
parse_block_html = true if Radiant::Config['kramdown_parse_block_html'] == 'true'
|
7
|
+
Kramdown::Document.new(RubyPants.new(text).to_html, {
|
8
|
+
:auto_ids => auto_ids || false,
|
9
|
+
:parse_block_html => parse_block_html || false,
|
10
|
+
}).to_html
|
5
11
|
end
|
6
12
|
end
|
data/markdown.html
ADDED
@@ -0,0 +1,120 @@
|
|
1
|
+
<p>Many people prefer <a href="http://daringfireball.net/projects/markdown/" target="_blank">Markdown</a>
|
2
|
+
over standard HTML because it is less verbose. Unlike Textile, Markdown
|
3
|
+
doesn’t try to replicate all of the features implemented by regular
|
4
|
+
HTML, instead it encourages the use of inline HTML. Markdown is very similar
|
5
|
+
to the formatting used in a standard plain-text e-mail. This filter also uses
|
6
|
+
<a href="http://daringfireball.net/projects/smartypants/" target="_blank">SmartyPants</a>
|
7
|
+
to curl quotes and insert correct punctuation.</p>
|
8
|
+
|
9
|
+
<table id="filter-reference-table">
|
10
|
+
<thead>
|
11
|
+
<tr>
|
12
|
+
<th>To see this:</th>
|
13
|
+
<th>Type this:</th>
|
14
|
+
<tr>
|
15
|
+
</thead>
|
16
|
+
<tbody>
|
17
|
+
<tr>
|
18
|
+
<td><strong>bold</strong></td>
|
19
|
+
<td><pre>**bold**</pre></td>
|
20
|
+
</tr>
|
21
|
+
<tr>
|
22
|
+
<td><em>italics</em></td>
|
23
|
+
<td><pre>_italics_</pre></td>
|
24
|
+
</tr>
|
25
|
+
<tr>
|
26
|
+
<td><del>strikethrough</del></td>
|
27
|
+
<td><pre><del>strikethrough</del></pre></td>
|
28
|
+
</tr>
|
29
|
+
<tr>
|
30
|
+
<td>x<sup>superscript</sup></td>
|
31
|
+
<td><pre>x<sup>superscript</sup></pre></td>
|
32
|
+
</tr>
|
33
|
+
<tr>
|
34
|
+
<td>a<sub>subscript</sub></td>
|
35
|
+
<td><pre>a<sub>subscript</sub></pre></td>
|
36
|
+
</tr>
|
37
|
+
<tr>
|
38
|
+
<td><code>code phrase</code></td>
|
39
|
+
<td><pre>`code phrase`</pre></td>
|
40
|
+
</tr>
|
41
|
+
<tr>
|
42
|
+
<td>link to <a href="http://radiantcms.org">Radiant CMS</a></td>
|
43
|
+
<td><pre>link to [Radiant CMS](http://radiantcms.org)</pre></td>
|
44
|
+
</tr>
|
45
|
+
<tr>
|
46
|
+
<td><acronym title="Just Another Acronym">JAA</acronym></td>
|
47
|
+
<td><pre><acronym title="Just Another Acronym">JAA</acronym></td>
|
48
|
+
</tr>
|
49
|
+
<tr>
|
50
|
+
<td><span style="color:red">Red Text</span></td>
|
51
|
+
<td><pre><span style="color:red">Red Text</span></pre></td>
|
52
|
+
</tr>
|
53
|
+
<tr>
|
54
|
+
<td>
|
55
|
+
<p>A bulleted list:</p>
|
56
|
+
<ul>
|
57
|
+
<li>item one</li>
|
58
|
+
<li>item two</li>
|
59
|
+
<li>item three</li>
|
60
|
+
</ul>
|
61
|
+
</td>
|
62
|
+
<td>
|
63
|
+
<pre>A bulleted list:
|
64
|
+
* item one
|
65
|
+
* item two
|
66
|
+
* item three</pre>
|
67
|
+
</td>
|
68
|
+
</tr>
|
69
|
+
<tr>
|
70
|
+
<td>
|
71
|
+
<p>A numbered list:</p>
|
72
|
+
<ol>
|
73
|
+
<li>item one</li>
|
74
|
+
<li>item two</li>
|
75
|
+
<li>item three</li>
|
76
|
+
</ol>
|
77
|
+
</td>
|
78
|
+
<td>
|
79
|
+
<pre>A numbered list:
|
80
|
+
1. item one
|
81
|
+
2. item two
|
82
|
+
3. item three</pre>
|
83
|
+
</td>
|
84
|
+
</tr>
|
85
|
+
<tr>
|
86
|
+
<td>
|
87
|
+
<h1>Heading 1</h1>
|
88
|
+
<h2>Heading 2</h2>
|
89
|
+
<h3>Heading 3</h3>
|
90
|
+
<h4>Heading 4</h4>
|
91
|
+
</td>
|
92
|
+
<td>
|
93
|
+
<pre>Heading 1
|
94
|
+
---------
|
95
|
+
|
96
|
+
Heading 2
|
97
|
+
=========
|
98
|
+
|
99
|
+
### Heading 3
|
100
|
+
|
101
|
+
#### Heading 4</pre>
|
102
|
+
</td>
|
103
|
+
</tr>
|
104
|
+
<tr>
|
105
|
+
<td><blockquote>Roses are red, violets are blue, Markdown is nice, and so are you!</blockquote></td>
|
106
|
+
<td>
|
107
|
+
<pre>> Roses are red,
|
108
|
+
> violets are blue,
|
109
|
+
> Markdown is nice,
|
110
|
+
> and so are you!</pre>
|
111
|
+
</tr>
|
112
|
+
<tr>
|
113
|
+
<td><img src="/images/admin/avatar_32x32.png" alt="alt text"></td>
|
114
|
+
<td><pre></pre></td>
|
115
|
+
</tr>
|
116
|
+
</tbody>
|
117
|
+
</table>
|
118
|
+
|
119
|
+
<p>Advanced users should review the
|
120
|
+
<a href="http://kramdown.rubyforge.org/quickref.html" target="_blank">kramdown Quick Reference</a>.</p>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: radiant-kramdown_filter-extension
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- johnmuhl
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-01-
|
12
|
+
date: 2010-01-27 00:00:00 -06:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -34,10 +34,11 @@ files:
|
|
34
34
|
- kramdown_filter_extension.rb
|
35
35
|
- lib/kramdown_filter.rb
|
36
36
|
- lib/tasks/kramdown_filter_extension_tasks.rake
|
37
|
+
- markdown.html
|
37
38
|
- Rakefile
|
38
39
|
- README.markdown
|
39
40
|
has_rdoc: true
|
40
|
-
homepage: http://
|
41
|
+
homepage: http://github.com/johnmuhl/radiant-kramdown_filter-extension
|
41
42
|
licenses: []
|
42
43
|
|
43
44
|
post_install_message:
|