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
This commit is contained in:
parent
4c243a146e
commit
8998606c7b
19
lib/haml.rb
19
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
|
||||
#
|
||||
|
|
31
lib/sass.rb
31
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 <tt>require "sass"</tt>
|
||||
# and using Sass::Engine like so:
|
||||
#
|
||||
# engine = Sass::Engine.new("#main\n :background-color #0000ff")
|
||||
|
|
Loading…
Reference in New Issue