From 8998606c7baa476e97d34c7ccdcd6eaa768a68b6 Mon Sep 17 00:00:00 2001 From: nex3 Date: Sun, 18 Nov 2007 09:19:21 +0000 Subject: [PATCH] Updated docs reflecting the new way to install Haml and Sass in Rails and Merb. git-svn-id: svn://hamptoncatlin.com/haml/trunk@619 7063305b-7217-0410-af8c-cdc13e5119b9 --- lib/haml.rb | 19 ++++++++++++++----- lib/sass.rb | 31 +++++++++++++++++++------------ 2 files changed, 33 insertions(+), 17 deletions(-) diff --git a/lib/haml.rb b/lib/haml.rb index dac1feef..39b0465d 100644 --- a/lib/haml.rb +++ b/lib/haml.rb @@ -27,20 +27,29 @@ $LOAD_PATH << dir unless $LOAD_PATH.include?(dir) # as a plugin for Ruby on Rails, # and as a standalong Ruby module. # -# === Rails +# Sass can be used in several ways: +# As a template engine for Ruby on Rails or Merb, +# or as a standalone engine. +# The first step for all of these is to install the Haml gem: +# +# gem install haml +# +# To enable it as a Rails plugin, +# then run # -# Haml is most commonly used as a plugin. -# It can be installed as a plugin using the Rails plugin installer: +# haml --rails path/to/rails/app # -# ./script/plugin install http://svn.hamptoncatlin.com/haml/tags/stable +# Haml is enabled in Merb by default, +# so Merb users don't have to do anything more. # # Once it's installed, all view files with the ".haml" extension +# (or ".html.haml" for Merb or edge Rails) # will be compiled using Haml. # # You can access instance variables in Haml templates # the same way you do in ERb templates. # Helper methods are also available in Haml templates. -# For example: +# For example (this example uses Rails, but the principle for Merb is the same): # # # file: app/controllers/movies_controller.rb # diff --git a/lib/sass.rb b/lib/sass.rb index 7666aa37..f34b9936 100644 --- a/lib/sass.rb +++ b/lib/sass.rb @@ -20,19 +20,29 @@ $LOAD_PATH << dir unless $LOAD_PATH.include?(dir) # # == Using Sass # -# Sass can be used in two ways: -# As a plugin for Ruby on Rails -# and as a standalone parser. +# Sass can be used in several ways: +# As a plugin for Ruby on Rails or Merb, +# or as a standalone parser. # Sass is bundled with Haml, # so if the Haml plugin or RubyGem is installed, # Sass will already be installed as a plugin or gem, respectively. +# The first step for all of these is to install the Haml gem: # -# To install Haml and Sass as a Ruby on Rails plugin, -# use the normal Rails plugin installer: +# gem install haml # -# ./script/plugin install http://svn.hamptoncatlin.com/haml/tags/stable +# To enable it as a Rails plugin, +# then run +# +# haml --rails path/to/rails/app +# +# To enable Sass in Merb, +# add # -# Sass templates in Rails don't quite function in the same way as views, +# dependency "haml" +# +# to config/dependencies.rb. +# +# Sass templates in Rails and Merb don't quite function in the same way as views, # because they don't contain dynamic content, # and so only need to be compiled when the template file has been updated. # By default (see options, below), @@ -41,11 +51,8 @@ $LOAD_PATH << dir unless $LOAD_PATH.include?(dir) # For instance, public/stylesheets/sass/main.sass would be compiled to public/stylesheets/main.css. # # Using Sass in Ruby code is very simple. -# First install the Haml/Sass RubyGem: -# -# gem install haml -# -# Then you can use it by including the "sass" gem +# After installing the Haml gem, +# you can use it by running require "sass" # and using Sass::Engine like so: # # engine = Sass::Engine.new("#main\n :background-color #0000ff")