Add support for slim templating language (because I love it)
This commit is contained in:
parent
93f919f309
commit
f3bd7bd3d1
7
features/slim.feature
Normal file
7
features/slim.feature
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
Feature: Support slim templating language
|
||||||
|
In order to offer an alternative to Haml
|
||||||
|
|
||||||
|
Scenario: Rendering Slim
|
||||||
|
Given the Server is running
|
||||||
|
When I go to "/slim.html"
|
||||||
|
Then I should see "<h1>Welcome to Slim</h1>"
|
|
@ -2,6 +2,7 @@ with_layout false do
|
||||||
page "/inline-css.html"
|
page "/inline-css.html"
|
||||||
page "/inline-js.html"
|
page "/inline-js.html"
|
||||||
page "/inline-coffeescript.html"
|
page "/inline-coffeescript.html"
|
||||||
|
page "/slim.html"
|
||||||
end
|
end
|
||||||
|
|
||||||
get "/page-class.html" do
|
get "/page-class.html" do
|
||||||
|
|
7
fixtures/test-app/source/slim.html.slim
Normal file
7
fixtures/test-app/source/slim.html.slim
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
doctype 5
|
||||||
|
html lang='en'
|
||||||
|
head
|
||||||
|
meta charset="utf-8"
|
||||||
|
|
||||||
|
body
|
||||||
|
h1 Welcome to Slim
|
|
@ -67,6 +67,7 @@ module Middleman
|
||||||
module Renderers
|
module Renderers
|
||||||
autoload :Haml, "middleman/renderers/haml"
|
autoload :Haml, "middleman/renderers/haml"
|
||||||
autoload :Sass, "middleman/renderers/sass"
|
autoload :Sass, "middleman/renderers/sass"
|
||||||
|
autoload :Slim, "middleman/renderers/slim"
|
||||||
end
|
end
|
||||||
|
|
||||||
# Features API
|
# Features API
|
||||||
|
|
12
lib/middleman/renderers/slim.rb
Normal file
12
lib/middleman/renderers/slim.rb
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
module Middleman
|
||||||
|
module Renderers
|
||||||
|
module Slim
|
||||||
|
class << self
|
||||||
|
def registered(app)
|
||||||
|
require "slim"
|
||||||
|
end
|
||||||
|
alias :included :registered
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -73,6 +73,7 @@ module Middleman
|
||||||
end
|
end
|
||||||
|
|
||||||
# Activate custom renderers
|
# Activate custom renderers
|
||||||
|
register Middleman::Renderers::Slim
|
||||||
register Middleman::Renderers::Haml
|
register Middleman::Renderers::Haml
|
||||||
register Middleman::Renderers::Sass
|
register Middleman::Renderers::Sass
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@ Gem::Specification.new do |s|
|
||||||
s.add_runtime_dependency("padrino-helpers", ["~> 0.9.23"])
|
s.add_runtime_dependency("padrino-helpers", ["~> 0.9.23"])
|
||||||
s.add_runtime_dependency("rack-test", ["~> 0.5.0"])
|
s.add_runtime_dependency("rack-test", ["~> 0.5.0"])
|
||||||
s.add_runtime_dependency("uglifier", ["~> 0.5.0"])
|
s.add_runtime_dependency("uglifier", ["~> 0.5.0"])
|
||||||
|
s.add_runtime_dependency("slim", ["~> 0.9.4"])
|
||||||
s.add_runtime_dependency("haml", ["~> 3.1.0"])
|
s.add_runtime_dependency("haml", ["~> 3.1.0"])
|
||||||
s.add_runtime_dependency("coffee-filter", ["~> 0.1.0"])
|
s.add_runtime_dependency("coffee-filter", ["~> 0.1.0"])
|
||||||
s.add_runtime_dependency("sass", ["~> 3.1.0"])
|
s.add_runtime_dependency("sass", ["~> 3.1.0"])
|
||||||
|
|
Loading…
Reference in a new issue