From 8613a5889659704ffc77543f46dc19b427990384 Mon Sep 17 00:00:00 2001 From: Thomas Reynolds Date: Sat, 19 Nov 2011 14:54:03 -0800 Subject: [PATCH] autoload slim and maruku --- lib/middleman/core_extensions/rendering.rb | 6 ++++++ lib/middleman/renderers/markdown.rb | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/middleman/core_extensions/rendering.rb b/lib/middleman/core_extensions/rendering.rb index 537cbcca..7b8a2c54 100644 --- a/lib/middleman/core_extensions/rendering.rb +++ b/lib/middleman/core_extensions/rendering.rb @@ -1,8 +1,14 @@ module Middleman::CoreExtensions::Rendering class << self def registered(app) + # Autoload require "coffee_script" + begin + require "slim" + rescue LoadError + end + # Activate custom renderers app.register Middleman::Renderers::Sass app.register Middleman::Renderers::Markdown diff --git a/lib/middleman/renderers/markdown.rb b/lib/middleman/renderers/markdown.rb index 7c4899f0..bb0e0077 100644 --- a/lib/middleman/renderers/markdown.rb +++ b/lib/middleman/renderers/markdown.rb @@ -3,7 +3,13 @@ module Middleman::Renderers::Markdown def registered(app) app.send :include, InstanceMethods - app.set :markdown_engine, nil + begin + require "maruku" + app.set :markdown_engine, :maruku + rescue LoadError + app.set :markdown_engine, nil + end + app.set :markdown_engine_prefix, ::Tilt app.after_configuration do