radiant-kramdown_filter-extension 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -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://kramdown.rubyforge.org/index.html"
9
+ url "http://github.com/johnmuhl/radiant-kramdown_filter-extension"
10
10
 
11
11
  def activate
12
12
  KramdownFilter
@@ -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
- Kramdown::Document.new(RubyPants.new(text).to_html).to_html
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
@@ -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&#8217;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>&lt;del&gt;strikethrough&lt;/del&gt;</pre></td>
28
+ </tr>
29
+ <tr>
30
+ <td>x<sup>superscript</sup></td>
31
+ <td><pre>x&lt;sup&gt;superscript&lt;/sup&gt;</pre></td>
32
+ </tr>
33
+ <tr>
34
+ <td>a<sub>subscript</sub></td>
35
+ <td><pre>a&lt;sub&gt;subscript&lt;/sub&gt;</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>&lt;acronym title="Just Another Acronym"&gt;JAA&lt;/acronym&gt;</td>
48
+ </tr>
49
+ <tr>
50
+ <td><span style="color:red">Red Text</span></td>
51
+ <td><pre>&lt;span style="color:red"&gt;Red Text&lt;/span&gt;</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>&gt; Roses are red,
108
+ &gt; violets are blue,
109
+ &gt; Markdown is nice,
110
+ &gt; 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>![alt text](/images/avatar_32x32.png)</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.1
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-26 00:00:00 -06:00
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://johnmuhl.com/junk/markdown
41
+ homepage: http://github.com/johnmuhl/radiant-kramdown_filter-extension
41
42
  licenses: []
42
43
 
43
44
  post_install_message: