diff --git a/README.md b/README.md index df3d4d1f..efa7ff53 100644 --- a/README.md +++ b/README.md @@ -1,59 +1,53 @@ # Haml -Haml is a templating engine for HTML. -It's are designed to make it both easier and more pleasant -to write HTML documents, -by eliminating redundancy, -reflecting the underlying structure that the document represents, -and providing elegant, easily understandable, and powerful syntax. +Haml is a templating engine for HTML. It's designed to make it both easier and +more pleasant to write HTML documents, by eliminating redundancy, reflecting the +underlying structure that the document represents, and providing an elegant syntax +that's both powerful and easy to understand. -## Using +## Basic Usage -Haml can be used from the command line -or as part of a Ruby web framework. -The first step is to install the gem: +Haml can be used from the command line or as part of a Ruby web framework. The +first step is to install the gem: gem install haml -After you convert some HTML to Haml, you can run +After you write some Haml, you can run haml document.haml -to compile them. -For more information on these commands, check out +to compile it to HTML. For more information on these commands, check out haml --help -To install Haml in Rails 2, -just add `config.gem "haml"` to `config/environment.rb`. -In Rails 3, add `gem "haml"` to your Gemfile instead. -and both Haml and Sass will be installed. -Views with the `.html.haml` extension will automatically use Haml. +To use Haml programatically, check out the [YARD +documentation](http://haml-lang.com/docs/yardoc/). -To use Haml programatically, -check out the [YARD documentation](http://haml-lang.com/docs/yardoc/). +## Using Haml with Rails + +To use Haml with Rails, simply add Haml to your Gemfile and run `bundle`. + +If you'd like to replace Rails's Erb-based generators with Haml, add +[haml-rails](https://github.com/indirect/haml-rails) to your Gemfile as well. ## Formatting -The most basic element of Haml -is a shorthand for creating HTML: +The most basic element of Haml is a shorthand for creating HTML: %tagname{:attr1 => 'value1', :attr2 => 'value2'} Contents -No end-tag is needed; Haml handles that automatically. -If you prefer HTML-style attributes, you can also use: +No end-tag is needed; Haml handles that automatically. If you prefer HTML-style +attributes, you can also use: %tagname(attr1='value1' attr2='value2') Contents -Adding `class` and `id` attributes is even easier. -Haml uses the same syntax as the CSS that styles the document: +Adding `class` and `id` attributes is even easier. Haml uses the same syntax as +the CSS that styles the document: %tagname#id.class -In fact, when you're using the `