# Output haml document tree & subfolders to another directory as html files

**URL:** <https://www.ruby-forum.com/t/output-haml-document-tree-subfolders-to-another-directory-as-html-files/192730>\
**Category:** Rails\
**Created:** [August 4, 2010, 4:03pm UTC](https://www.ruby-forum.com/t/output-haml-document-tree-subfolders-to-another-directory-as-html-files/192730 "2010-08-04T16:03:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rubybox](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/85e7bf/32.png) [@rubybox](https://www.ruby-forum.com/u/rubybox)\
**Post date:** [August 4, 2010, 4:03pm UTC](https://www.ruby-forum.com/t/output-haml-document-tree-subfolders-to-another-directory-as-html-files/192730/1 "2010-08-04T16:03:28Z")

</div>

I building themes with haml for a CMS based on php and zend  
framework.  
Although I could implement haml directly into it, I rather use ruby  
and therefore try to find a solution for this:

Go true a complete document tree and all subfolders, these folders  
contain haml files  
Then output each haml file in another directory like /output with  
preserve of the orginal document tree but as a saved html file

/haml\_templates/  
home.html.haml  
about.html.haml  
/subdir  
header.html.haml

I would run some tool or a ruby script that would create:

/haml\_exported/  
home.html  
about.html  
/subdir  
header.html

Is there something out I could use for above problem? I thought of  
creating a ruby script for this but that is rather to advanched at the  
moment for my ruby on rails skills.  
Hope to find a solution for this, please let me know if you have an  
idea! Thanks in advanche!

---

<div class="post-metadata">

**Author:** ![rubybox](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/85e7bf/32.png) [@rubybox](https://www.ruby-forum.com/u/rubybox)\
**Post date:** [August 4, 2010, 4:54pm UTC](https://www.ruby-forum.com/t/output-haml-document-tree-subfolders-to-another-directory-as-html-files/192730/2 "2010-08-04T16:54:38Z")

</div>

rubybox wrote:

> I building themes with haml for a CMS based on php and zend  
> framework.  
> Although I could implement haml directly into it, I rather use ruby  
> and therefore try to find a solution for this:

Seems like the wrong tool. Why not just use pHaml with the CMS?

If not, then perhaps something like StaticMatic is what you’re looking  
for.

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid
