From 7517ca681956dfd237a414c03c52ab30f52d3735 Mon Sep 17 00:00:00 2001 From: Gibheer Date: Tue, 19 Jul 2011 19:14:10 +0200 Subject: [PATCH] added syntax highlighting for code --- Gemfile | 2 ++ Gemfile.lock | 16 +++++++++++----- libs.rb | 3 +++ settings.rb.example | 8 ++------ views/post_single.haml | 2 +- 5 files changed, 19 insertions(+), 12 deletions(-) diff --git a/Gemfile b/Gemfile index 26b1233..6d0b329 100644 --- a/Gemfile +++ b/Gemfile @@ -10,5 +10,7 @@ gem 'data_mapper' gem 'dm-postgres-adapter' # the different markups +gem 'redclothcoderay' +gem 'coderay' gem 'RedCloth' gem 'redcarpet' diff --git a/Gemfile.lock b/Gemfile.lock index 966dd05..b5faa7f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -5,7 +5,8 @@ GEM addressable (2.2.6) bcrypt-ruby (2.1.4) chunky_png (1.2.0) - compass (0.11.3) + coderay (0.9.8) + compass (0.11.5) chunky_png (~> 1.2) fssm (>= 0.2.7) sass (~> 3.1) @@ -58,17 +59,20 @@ GEM fssm (0.2.7) haml (3.1.2) json (1.4.6) - rack (1.3.0) - rack-flash (0.1.1) + rack (1.3.1) + rack-flash (0.1.2) rack redcarpet (1.17.2) - sass (3.1.3) + redclothcoderay (0.3.6) + RedCloth + coderay + sass (3.1.4) sinatra (1.2.6) rack (~> 1.1) tilt (>= 1.2.2, < 2.0) sinatra-support (1.2.0) sinatra (>= 1.0) - stringex (1.2.1) + stringex (1.2.2) tilt (1.3.2) uuidtools (2.1.2) @@ -77,12 +81,14 @@ PLATFORMS DEPENDENCIES RedCloth + coderay compass data_mapper dm-postgres-adapter haml rack-flash redcarpet + redclothcoderay sass sinatra sinatra-support diff --git a/libs.rb b/libs.rb index 44bd0d0..3ad054d 100644 --- a/libs.rb +++ b/libs.rb @@ -13,6 +13,9 @@ require 'rack-flash' # markups require 'redcloth' require 'redcarpet' +require 'coderay' +require 'redclothcoderay' +RedclothCoderay.coderay_options :css => :class require 'settings' diff --git a/settings.rb.example b/settings.rb.example index eaf56af..f42c1f3 100644 --- a/settings.rb.example +++ b/settings.rb.example @@ -1,9 +1,3 @@ -Compass.configuration do |config| - config.sass_dir = 'views' - config.project_path = File.dirname(__FILE__) - config.output_style = :expanded -end - $settings = { :environment => :development, :logging => true, @@ -20,3 +14,5 @@ case $settings[:environment] :default, 'postgres://:@localhost/' ) end + +RedclothCoderay.coderay_options :css => :class diff --git a/views/post_single.haml b/views/post_single.haml index de1fdb9..69dea16 100644 --- a/views/post_single.haml +++ b/views/post_single.haml @@ -4,4 +4,4 @@ %footer .author=@post.account.username .date=@post.written - %section=markup(@post.content, @post.markup) + %section~markup(@post.content, @post.markup)