coderay support
This commit is contained in:
parent
0ae1eafcbb
commit
a3b276d489
8 changed files with 48 additions and 23 deletions
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
0.99.3.pre
|
||||
0.99.4.pre
|
||||
|
|
|
@ -9,6 +9,8 @@ module Middleman::Features
|
|||
autoload :MinifyJavascript, "middleman/features/minify_javascript"
|
||||
autoload :Slickmap, "middleman/features/slickmap"
|
||||
autoload :SmushPNGs, "middleman/features/smush_pngs"
|
||||
autoload :CodeRay, "middleman/features/code_ray"
|
||||
# autoload :LiveReload, "middleman/features/live_reload"
|
||||
|
||||
class << self
|
||||
def registered(app)
|
||||
|
|
12
lib/middleman/features/code_ray.rb
Normal file
12
lib/middleman/features/code_ray.rb
Normal file
|
@ -0,0 +1,12 @@
|
|||
module Middleman::Features::CodeRay
|
||||
class << self
|
||||
def registered(app)
|
||||
begin
|
||||
require 'haml-coderay'
|
||||
rescue LoadError
|
||||
puts "CodeRay not available. Install it with: gem install haml-coderay"
|
||||
end
|
||||
end
|
||||
alias :included :registered
|
||||
end
|
||||
end
|
21
lib/middleman/features/live_reload.rb
Normal file
21
lib/middleman/features/live_reload.rb
Normal file
|
@ -0,0 +1,21 @@
|
|||
module Middleman::Features::LiveReload
|
||||
class << self
|
||||
def registered(app)
|
||||
return unless Middleman::Server.environment == :development
|
||||
|
||||
begin
|
||||
require 'livereload'
|
||||
rescue LoadError
|
||||
puts "Livereload not available. Install it with: gem install livereload"
|
||||
end
|
||||
|
||||
new_config = ::LiveReload::Config.new do |config|
|
||||
config.exts = ::Tilt.mappings.keys
|
||||
end
|
||||
|
||||
# Middleman::Server.public
|
||||
::LiveReload.run [Middleman::Server.views], new_config
|
||||
end
|
||||
alias :included :registered
|
||||
end
|
||||
end
|
|
@ -1,19 +0,0 @@
|
|||
module Middleman::Features::LiveReload
|
||||
def initialize(app, config)
|
||||
return unless Middleman::Server.environment == :development
|
||||
|
||||
begin
|
||||
require 'livereload'
|
||||
rescue LoadError
|
||||
puts "Livereload not available. Install it with: gem install livereload"
|
||||
end
|
||||
|
||||
new_config = ::LiveReload::Config.new do |config|
|
||||
config.exts = %w(haml sass scss coffee less builder)
|
||||
end
|
||||
|
||||
::LiveReload.run [Middleman::Server.public, Middleman::Server.views], new_config
|
||||
end
|
||||
end
|
||||
|
||||
Middleman::Features.register :livereload, Middleman::Features::LiveReload
|
|
@ -128,6 +128,9 @@ module Middleman
|
|||
return result
|
||||
end
|
||||
|
||||
status 404
|
||||
rescue Padrino::Rendering::TemplateNotFound
|
||||
$stderr.puts "File not found: #{request.path}"
|
||||
status 404
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
# Automatic sitemaps
|
||||
# activate :slickmap
|
||||
|
||||
# CodeRay syntax highlighting in Haml
|
||||
# activate :code_ray
|
||||
|
||||
# Automatic image dimension calculations
|
||||
# activate :automatic_image_sizes
|
||||
|
||||
|
@ -51,6 +54,10 @@ configure :build do
|
|||
|
||||
# Enable cache buster
|
||||
# activate :cache_buster
|
||||
|
||||
# Generate ugly/obfuscated HTML from Haml
|
||||
# activate :ugly_haml
|
||||
|
||||
|
||||
# Or use a different image path
|
||||
# set :http_path, "/Content/images/"
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
|
||||
Gem::Specification.new do |s|
|
||||
s.name = %q{middleman}
|
||||
s.version = "0.99.3.pre"
|
||||
s.version = "0.99.4.pre"
|
||||
|
||||
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
||||
s.authors = ["Thomas Reynolds"]
|
||||
s.date = %q{2010-09-11}
|
||||
s.date = %q{2010-09-21}
|
||||
s.email = %q{tdreyno@gmail.com}
|
||||
s.executables = ["mm-init", "mm-build", "mm-server"]
|
||||
s.extra_rdoc_files = [
|
||||
|
@ -84,7 +84,6 @@ Gem::Specification.new do |s|
|
|||
"lib/middleman/features/automatic_image_sizes/fastimage.rb",
|
||||
"lib/middleman/features/cache_buster.rb",
|
||||
"lib/middleman/features/default_helpers.rb",
|
||||
"lib/middleman/features/livereload.rb",
|
||||
"lib/middleman/features/minify_css.rb",
|
||||
"lib/middleman/features/minify_javascript.rb",
|
||||
"lib/middleman/features/minify_javascript/rack.rb",
|
||||
|
|
Loading…
Reference in a new issue