lib/enhancements.rb in nanoc-1.2 vs lib/enhancements.rb in nanoc-1.3

- old
+ new

@@ -5,10 +5,11 @@ require 'erubis' require 'fileutils' require 'yaml' try_require 'bluecloth' +try_require 'redcloth' try_require 'rubypants' try_require 'markaby' try_require 'liquid' try_require 'haml' try_require 'rdoc/markup/simple_markup' @@ -73,16 +74,20 @@ result.replace(result.haml(a_params[:assigns])) when 'liquid' result.replace(result.liquid(a_params[:assigns])) when 'markaby' result.replace(result.markaby(a_params[:assigns])) - when 'markdown' + when 'markdown', 'bluecloth' result.replace(result.markdown) when 'rdoc' result.replace(result.rdoc) - when 'smartypants' + when 'sass' + result.replace(result.sass) + when 'smartypants', 'rubypants' result.replace(result.smartypants) + when 'textile', 'redcloth' + result.replace(result.textile) end end end # Converts the string using eRuby. @@ -124,9 +129,14 @@ end # Converts the string using RDoc def rdoc SM::SimpleMarkup.new.convert(self, SM::ToHtml.new) + end + + # Converts the string using Sass + def sass + Sass::Engine.new(self).render end # Converts the string using RedCloth/Textile def textile RedCloth.new(self).to_html