new minor version of the mounter (fix the problem of slowness of big sites) + replace RedCloth by Redcarpet
did
committed Aug 20, 2013
commit 98a1028f2ce1f4ef9494e5f14386842d08bb5176
Showing 6
changed files with
49 additions
and 8 deletions
locomotive/wagon/liquid/filters/text.rb b/lib/locomotive/wagon/liquid/filters/text.rb
+1
-3
| @@ | @@ -1,5 +1,3 @@ |
| - | require 'RedCloth' |
| - | |
| module Locomotive | |
| module Wagon | |
| module Liquid | |
| @@ | @@ -36,7 +34,7 @@ module Locomotive |
| end | |
| def textile(input) | |
| - | ::RedCloth.new(input).to_html |
| + | Locomotive::Wagon::Markdown.render(input) |
| end | |
| end | |
locomotive/wagon/misc.rb b/lib/locomotive/wagon/misc.rb
+3
-1
| @@ | @@ -3,4 +3,6 @@ require 'locomotive/wagon/misc/will_paginate.rb' |
| require 'locomotive/wagon/misc/httparty.rb' | |
| require 'locomotive/wagon/misc/dragonfly.rb' | |
| require 'locomotive/wagon/misc/i18n.rb' | |
| - | require 'locomotive/wagon/misc/mounter.rb' |
| \ No newline at end of file | |
| + | require 'locomotive/wagon/misc/mounter.rb' |
| + | require 'locomotive/wagon/misc/markdown.rb' |
| + | require 'locomotive/wagon/misc/haml.rb' |
| \ No newline at end of file | |
locomotive/wagon/misc/haml.rb b/lib/locomotive/wagon/misc/haml.rb
+15
-0
| @@ | @@ -0,0 +1,15 @@ |
| + | module Haml::Filters |
| + | |
| + | remove_filter("Markdown") #remove the existing Markdown filter |
| + | |
| + | module Markdown # the contents of this are as before, but without the lazy_require call |
| + | |
| + | include Haml::Filters::Base |
| + | |
| + | def render text |
| + | Locomotive::Wagon::Markdown.render text |
| + | end |
| + | |
| + | end |
| + | |
| + | end |
| \ No newline at end of file | |
locomotive/wagon/misc/markdown.rb b/lib/locomotive/wagon/misc/markdown.rb
+27
-0
| @@ | @@ -0,0 +1,27 @@ |
| + | require 'redcarpet' |
| + | |
| + | module Locomotive |
| + | module Wagon |
| + | module Markdown |
| + | |
| + | def self.render(text) |
| + | self.parser.render(text) |
| + | end |
| + | |
| + | def self.parser |
| + | @@markdown ||= Redcarpet::Markdown.new Redcarpet::Render::HTML, { |
| + | autolink: true, |
| + | fenced_code: true, |
| + | generate_toc: true, |
| + | gh_blockcode: true, |
| + | hard_wrap: true, |
| + | no_intraemphasis: true, |
| + | strikethrough: true, |
| + | tables: true, |
| + | xhtml: true |
| + | } |
| + | end |
| + | |
| + | end |
| + | end |
| + | end |
| \ No newline at end of file | |
locomotive/wagon/server.rb b/lib/locomotive/wagon/server.rb
+0
-1
| @@ | @@ -2,7 +2,6 @@ require 'better_errors' |
| require 'coffee_script' | |
| require 'sprockets' | |
| require 'sprockets-sass' | |
| - | # require 'active_support/time' |
| require 'locomotive/wagon/listen' | |
| require 'locomotive/wagon/server/middleware' | |
locomotivecms_wagon.gemspec
+3
-3
| @@ | @@ -19,10 +19,10 @@ Gem::Specification.new do |gem| |
| gem.executables = ['wagon'] | |
| gem.add_dependency 'thor' | |
| - | gem.add_dependency 'thin' |
| + | gem.add_dependency 'thin', '~> 1.5.1' |
| gem.add_dependency 'activesupport', '~> 3.2.11' | |
| gem.add_dependency 'locomotivecms_solid', '~> 0.2.1' | |
| - | gem.add_dependency 'RedCloth', '~> 4.2.9' |
| + | gem.add_dependency 'redcarpet', '~> 3.0.0' |
| gem.add_dependency 'dragonfly', '~> 0.9.12' | |
| gem.add_dependency 'sprockets', '~> 2.0' | |
| gem.add_dependency 'sprockets-sass', '~> 1.0.1' | |
| @@ | @@ -34,7 +34,7 @@ Gem::Specification.new do |gem| |
| gem.add_dependency 'httmultiparty', '0.3.10' | |
| gem.add_dependency 'will_paginate', '~> 3.0.3' | |
| - | gem.add_dependency 'locomotivecms_mounter', '~> 1.2.3' |
| + | gem.add_dependency 'locomotivecms_mounter', '~> 1.2.4' |
| gem.add_dependency 'faker', '~> 0.9.5' | |