radiant-bluecloth2_filter-extension 1.0.0

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.
@@ -0,0 +1 @@
1
+ bluecloth 2 markdown filter
@@ -0,0 +1,120 @@
1
+ # I think this is the one that should be moved to the extension Rakefile template
2
+
3
+ # In rails 1.2, plugins aren't available in the path until they're loaded.
4
+ # Check to see if the rspec plugin is installed first and require
5
+ # it if it is. If not, use the gem version.
6
+
7
+ # Determine where the RSpec plugin is by loading the boot
8
+ unless defined? RADIANT_ROOT
9
+ ENV["RAILS_ENV"] = "test"
10
+ case
11
+ when ENV["RADIANT_ENV_FILE"]
12
+ require File.dirname(ENV["RADIANT_ENV_FILE"]) + "/boot"
13
+ when File.dirname(__FILE__) =~ %r{vendor/radiant/vendor/extensions}
14
+ require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../../")}/config/boot"
15
+ else
16
+ require "#{File.expand_path(File.dirname(__FILE__) + "/../../../")}/config/boot"
17
+ end
18
+ end
19
+
20
+ require 'rake'
21
+ require 'rake/rdoctask'
22
+ require 'rake/testtask'
23
+
24
+ rspec_base = File.expand_path(RADIANT_ROOT + '/vendor/plugins/rspec/lib')
25
+ $LOAD_PATH.unshift(rspec_base) if File.exist?(rspec_base)
26
+ require 'spec/rake/spectask'
27
+ # require 'spec/translator'
28
+
29
+ # Cleanup the RADIANT_ROOT constant so specs will load the environment
30
+ Object.send(:remove_const, :RADIANT_ROOT)
31
+
32
+ extension_root = File.expand_path(File.dirname(__FILE__))
33
+
34
+ task :default => :spec
35
+ task :stats => "spec:statsetup"
36
+
37
+ desc "Run all specs in spec directory"
38
+ Spec::Rake::SpecTask.new(:spec) do |t|
39
+ t.spec_opts = ['--options', "\"#{extension_root}/spec/spec.opts\""]
40
+ t.spec_files = FileList['spec/**/*_spec.rb']
41
+ end
42
+
43
+ namespace :spec do
44
+ desc "Run all specs in spec directory with RCov"
45
+ Spec::Rake::SpecTask.new(:rcov) do |t|
46
+ t.spec_opts = ['--options', "\"#{extension_root}/spec/spec.opts\""]
47
+ t.spec_files = FileList['spec/**/*_spec.rb']
48
+ t.rcov = true
49
+ t.rcov_opts = ['--exclude', 'spec', '--rails']
50
+ end
51
+
52
+ desc "Print Specdoc for all specs"
53
+ Spec::Rake::SpecTask.new(:doc) do |t|
54
+ t.spec_opts = ["--format", "specdoc", "--dry-run"]
55
+ t.spec_files = FileList['spec/**/*_spec.rb']
56
+ end
57
+
58
+ [:models, :controllers, :views, :helpers].each do |sub|
59
+ desc "Run the specs under spec/#{sub}"
60
+ Spec::Rake::SpecTask.new(sub) do |t|
61
+ t.spec_opts = ['--options', "\"#{extension_root}/spec/spec.opts\""]
62
+ t.spec_files = FileList["spec/#{sub}/**/*_spec.rb"]
63
+ end
64
+ end
65
+
66
+ # Hopefully no one has written their extensions in pre-0.9 style
67
+ # desc "Translate specs from pre-0.9 to 0.9 style"
68
+ # task :translate do
69
+ # translator = ::Spec::Translator.new
70
+ # dir = RAILS_ROOT + '/spec'
71
+ # translator.translate(dir, dir)
72
+ # end
73
+
74
+ # Setup specs for stats
75
+ task :statsetup do
76
+ require 'code_statistics'
77
+ ::STATS_DIRECTORIES << %w(Model\ specs spec/models)
78
+ ::STATS_DIRECTORIES << %w(View\ specs spec/views)
79
+ ::STATS_DIRECTORIES << %w(Controller\ specs spec/controllers)
80
+ ::STATS_DIRECTORIES << %w(Helper\ specs spec/views)
81
+ ::CodeStatistics::TEST_TYPES << "Model specs"
82
+ ::CodeStatistics::TEST_TYPES << "View specs"
83
+ ::CodeStatistics::TEST_TYPES << "Controller specs"
84
+ ::CodeStatistics::TEST_TYPES << "Helper specs"
85
+ ::STATS_DIRECTORIES.delete_if {|a| a[0] =~ /test/}
86
+ end
87
+
88
+ namespace :db do
89
+ namespace :fixtures do
90
+ desc "Load fixtures (from spec/fixtures) into the current environment's database. Load specific fixtures using FIXTURES=x,y"
91
+ task :load => :environment do
92
+ require 'active_record/fixtures'
93
+ ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym)
94
+ (ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : Dir.glob(File.join(RAILS_ROOT, 'spec', 'fixtures', '*.{yml,csv}'))).each do |fixture_file|
95
+ Fixtures.create_fixtures('spec/fixtures', File.basename(fixture_file, '.*'))
96
+ end
97
+ end
98
+ end
99
+ end
100
+ end
101
+
102
+ desc 'Generate documentation for the <%= file_name %> extension.'
103
+ Rake::RDocTask.new(:rdoc) do |rdoc|
104
+ rdoc.rdoc_dir = 'rdoc'
105
+ rdoc.title = '<%= class_name %>'
106
+ rdoc.options << '--line-numbers' << '--inline-source'
107
+ rdoc.rdoc_files.include('README')
108
+ rdoc.rdoc_files.include('lib/**/*.rb')
109
+ end
110
+
111
+ # For extensions that are in transition
112
+ desc 'Test the <%= file_name %> extension.'
113
+ Rake::TestTask.new(:test) do |t|
114
+ t.libs << 'lib'
115
+ t.pattern = 'test/**/*_test.rb'
116
+ t.verbose = true
117
+ end
118
+
119
+ # Load any custom rakefiles for extension
120
+ Dir[File.dirname(__FILE__) + '/tasks/*.rake'].sort.each { |f| require f }
@@ -0,0 +1,9 @@
1
+ class Bluecloth2FilterExtension < Radiant::Extension
2
+ version "1.0"
3
+ description "Allows you to compose page parts or snippets using the Markdown text filter. (RDiscount)"
4
+ url "http://daringfireball.net/projects/markdown/syntax"
5
+
6
+ def activate
7
+ Bluecloth2Filter
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ gem 'bluecloth', '>= 2.0.7'
2
+ require 'bluecloth'
3
+
4
+ class Bluecloth2Filter < TextFilter
5
+ description_file File.dirname(__FILE__) + "/../markdown.html"
6
+ def filter(text)
7
+ BlueCloth.new(text, :smartypants => true).to_html
8
+ end
9
+ end
@@ -0,0 +1,12 @@
1
+ namespace :radiant do
2
+ namespace :extensions do
3
+ namespace :bluecloth2_filter do
4
+ task :migrate do
5
+ puts("The bluecloth2_filter doesn't have any migrate tasks to run.")
6
+ end
7
+ task :update do
8
+ puts("The bluecloth2_filter doesn't have any static assets to copy.")
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,121 @@
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.</p>
6
+
7
+ <table id="filter-reference-table" border="0" cellpadding="0" cellspacing="0">
8
+ <thead>
9
+ <tr>
10
+ <th>To see this:</th>
11
+ <th>Type this:</th>
12
+ <tr>
13
+ </thead>
14
+ <tbody>
15
+ <tr>
16
+ <td><strong>bold</strong></td>
17
+ <td><pre>**bold**</pre></td>
18
+ </tr>
19
+ <tr>
20
+ <td><em>italics</em></td>
21
+ <td><pre>_italics_</pre></td>
22
+ </tr>
23
+ <tr>
24
+ <td><del>strikethrough</del></td>
25
+ <td><pre>&lt;del&gt;strikethrough&lt;/del&gt;</pre></td>
26
+ </tr>
27
+ <tr>
28
+ <td>x<sup>superscript</sup></td>
29
+ <td><pre>x&lt;sup&gt;superscript&lt;/sup&gt;</pre></td>
30
+ </tr>
31
+ <tr>
32
+ <td>a<sub>subscript</sub></td>
33
+ <td><pre>a&lt;sub&gt;subscript&lt;/sub&gt;</pre></td>
34
+ </tr>
35
+ <tr>
36
+ <td><code>code phrase</code></td>
37
+ <td><pre>`code phrase`</pre></td>
38
+ </tr>
39
+ <tr>
40
+ <td>link to <a href="http://radiantcms.org">Radiant CMS</a></td>
41
+ <td><pre>link to [Radiant CMS](http://radiantcms.org)</pre></td>
42
+ </tr>
43
+ <tr>
44
+ <td><acronym title="Just Another Acronym">JAA</acronym></td>
45
+ <td><pre>&lt;acronym title="Just Another Acronym"&gt;JAA&lt;/acronym&gt;</td>
46
+ </tr>
47
+ <tr>
48
+ <td><span style="color:red">Red Text</span></td>
49
+ <td><pre>&lt;span style="color:red"&gt;Red Text&lt;/span&gt;</pre></td>
50
+ </tr>
51
+ <tr>
52
+ <td>
53
+ <p>A bulleted list:</p>
54
+ <ul>
55
+ <li>item one</li>
56
+ <li>item two</li>
57
+ <li>item three</li>
58
+ </ul>
59
+ </td>
60
+ <td>
61
+ <pre>A bulleted list:
62
+ * item one
63
+ * item two
64
+ * item three</pre>
65
+ </td>
66
+ </tr>
67
+ <tr>
68
+ <td>
69
+ <p>A numbered list:</p>
70
+ <ol>
71
+ <li>item one</li>
72
+ <li>item two</li>
73
+ <li>item three</li>
74
+ </ol>
75
+ </td>
76
+ <td>
77
+ <pre>A numbered list:
78
+ 1. item one
79
+ 2. item two
80
+ 3. item three</pre>
81
+ </td>
82
+ </tr>
83
+ <tr>
84
+ <td>
85
+ <h1>Heading 1</h1>
86
+ <h2>Heading 2</h2>
87
+ <h3>Heading 3</h3>
88
+ <h4>Heading 4</h4>
89
+ </td>
90
+ <td>
91
+ <pre>Heading 1
92
+ ---------
93
+
94
+ Heading 2
95
+ =========
96
+
97
+ ### Heading 3
98
+
99
+ #### Heading 4</pre>
100
+ </td>
101
+ </tr>
102
+ <tr>
103
+ <td><blockquote>Roses are red, violets are blue, Markdown is nice, and so are you!</blockquote></td>
104
+ <td>
105
+ <pre>&gt; Roses are red,
106
+ &gt; violets are blue,
107
+ &gt; Markdown is nice,
108
+ &gt; and so are you!</pre>
109
+ </tr>
110
+ <tr>
111
+ <td><img src="http://radiantcms.org/button.png" alt="" /></td>
112
+ <td><pre>![alt text](http://radiantcms.org/button.png)</pre></td>
113
+ </tr>
114
+ </tbody>
115
+ </table>
116
+
117
+ <p>Advanced users may want to play around with the
118
+ <a href="http://daringfireball.net/projects/markdown/dingus/" target="_blank">Markdown
119
+ Dingus</a> or review the
120
+ <a href="http://daringfireball.net/projects/markdown/syntax/" target="_blank">official Markdown
121
+ Reference</a>.</p>
metadata ADDED
@@ -0,0 +1,80 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: radiant-bluecloth2_filter-extension
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 1
7
+ - 0
8
+ - 0
9
+ version: 1.0.0
10
+ platform: ruby
11
+ authors:
12
+ - johnmuhl
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2010-03-03 00:00:00 -06:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: bluecloth
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 2
29
+ - 0
30
+ - 7
31
+ version: 2.0.7
32
+ type: :runtime
33
+ version_requirements: *id001
34
+ description: Radiant CMS extension that wraps the Bluecloth 2 Markdown converter.
35
+ email: git@johnmuhl.com
36
+ executables: []
37
+
38
+ extensions: []
39
+
40
+ extra_rdoc_files: []
41
+
42
+ files:
43
+ - bluecloth2_filter_extension.rb
44
+ - lib/bluecloth2_filter.rb
45
+ - lib/tasks/bluecloth2_filter_extension_tasks.rake
46
+ - markdown.html
47
+ - Rakefile
48
+ - README.markdown
49
+ has_rdoc: true
50
+ homepage: http://github.com/johnmuhl/radiant-bluecloth2_filter-extension
51
+ licenses: []
52
+
53
+ post_install_message:
54
+ rdoc_options: []
55
+
56
+ require_paths:
57
+ - lib
58
+ required_ruby_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ segments:
63
+ - 0
64
+ version: "0"
65
+ required_rubygems_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ segments:
70
+ - 0
71
+ version: "0"
72
+ requirements: []
73
+
74
+ rubyforge_project:
75
+ rubygems_version: 1.3.6
76
+ signing_key:
77
+ specification_version: 3
78
+ summary: Bluecloth 2 filter for Radiant CMS
79
+ test_files: []
80
+