The main API for using Haml programmatically is Haml::Engine:
http://haml-lang.com/docs/yardoc/Haml/Engine.html . Check out those
API docs and let me know if you have any questions.

On Thu, Apr 15, 2010 at 8:43 AM, John Feminella <[email protected]> wrote:
> hello,
>
> I'm looking at putting together an extremely simple engine for
> generating a set of static pages from Haml. I really like Haml's
> approach to clean markup and am a devoted fan of it wrt Rails apps.
> However, a lot of the guidance I've read assumes that you'll be using
> Haml with Rails, and I'm not sure I understand which aspects of Haml
> are valid in a Rails environment and which need to be adjusted if
> you're not using Rails.
>
> As a trivial example, what would be great to see is how you'd output a
> series of page to static .html files based on the contents of an
> Array. For instance, suppose you have a `fruit_controller.rb` file
> that declares `fruits = ["apple", "banana", "cherry"]` and a Haml
> template `fruit.haml`. The template prints a blank HTML page and sets
> the title to whatever value is stored in `fruit`. How would you pass
> each value in the array to the same `fruit.haml` template and write a
> set of files named {apple,banana,cherry}.html to disk?
>
> This sort of nuts-and-bolts stuff represents the critical bulk of what
> I'd be doing. Are there tutorials or examples I can look at to get a
> feel for these and similar tasks?
>
> Thanks!
>
> ~ jf
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Haml" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/haml?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/haml?hl=en.

Reply via email to