From 66059466f94ff052bab5ce925d7eadacca38ac36 Mon Sep 17 00:00:00 2001 From: packagethief Date: Mon, 6 Nov 2006 01:20:40 +0000 Subject: [PATCH] Updated documentation to describe creating multiple-class attributes for an element; minor documentation changes git-svn-id: svn://hamptoncatlin.com/haml/branches/edge@119 7063305b-7217-0410-af8c-cdc13e5119b9 --- REFERENCE | 41 +++++++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/REFERENCE b/REFERENCE index c4c83405..2655d9f2 100644 --- a/REFERENCE +++ b/REFERENCE @@ -1,6 +1,6 @@ = Haml (XHTML Abstraction Markup Language) -HAML is a markup language that's used to cleanly and simply describe the XHTML +Haml is a markup language that's used to cleanly and simply describe the XHTML of any web document without the use of inline code. Haml functions as a replacement for inline page templating systems such PHP, RHTML, and ASP. However, Haml avoids the need for explicitly coding XHTML into the template, @@ -18,7 +18,7 @@ dynamic content. == Authors -HAML was originally created by Hampton Catlin (hcatlin). Help with the +Haml was originally created by Hampton Catlin (hcatlin). Help with the Ruby On Rails implementation and much of the documentation by Jeff Hardy (packagethief). @@ -53,7 +53,7 @@ is compiled to: == Characters with meaning to Haml -Various characters, when placed at a certain point in a line, instruct HAML +Various characters, when placed at a certain point in a line, instruct Haml to render different types of things. === XHTML Tags @@ -145,9 +145,11 @@ is compiled to: ==== . and # -The period and pound sign are borrowed from CSS and used as shortcuts to specify the -class and id attributes of an element, respectively. They are -placed immediately after the tag, and before an attributes hash. For example: +The period and sharp sign are borrowed from CSS and used as shortcuts to specify the +class and id attributes of an element, respectively. Multiple class +attributes can be specified by chaining thier names together with a dot, similiar to the +way they are expressed in CSS. They should be placed immediately after the element name +and before an optional attributes hash. For example: div#things %span#rice Chicken Fried @@ -162,7 +164,30 @@ is compiled to:

La La La

-==== Assumed Divs +And, + + #content + .articles + .article.title + Doogie Howser Comes Out + .article.date + 2006-11-05 + .article.entry + Neil Patrick Harris would like to dispel any rumors that he is straight + +is compiled to: + +
+
+
Doogie Howser Comes Out
+
2006-11-05
+
+ Neil Patrick Harris would like to dispel any rumors that he is straight +
+
+
+ +==== Implicit Div Elements Because the div element is used so often, it is the default element. If you only define a class and/or id using the . or # syntax, a div element @@ -443,7 +468,7 @@ is compiled to: ===== Blocks Like XHTML tags, you don't need to explicity close your Ruby blocks in -HAML. Rather, they're automatically closed based on tabs. A block begins +Haml. Rather, they're automatically closed based on spacing. A block begins whenever the indentation is increased after a silent script command, and ends when the indentation decreases (as long as it's not an +else+ clause or something similar). For example: