views:

138

answers:

1

I'm a ruby/haml/sass-beginner. I just installed ruby and rails for windows, haml, and sass (stand alone and plugin for rails).

I know how to convert and haml file into a html file (and vice versa):

haml index.haml > output.html

and how to convert a scss fiel into a css file (and vice versa):

sass --watch style.scss:style.css

I save more time converting scss files because every time I save a scss file the corresponding css file is automatically updated (i think that's the suppose of the watch command)

but for the haml files, I'm still doing it manually (haml index.haml > output.html).

I believe there's other ways to save time converting haml and scss files.

Any suggestions?

+2  A: 

When you setup Rails to work with Haml, then start your development server, the Haml in your views get converted into HTML for you on-the-fly, so there's no need to watch for changes to your Haml separately.

However, if you're creating prototypes using just Haml and SCSS and not using the Rails stack at this stage, then there are a couple of useful tools you can use that automatically render your Haml and SCSS on page refresh:

Serve http://github.com/jlong/serve

StaticMatic http://github.com/staticmatic/staticmatic

Of these two, Serve is easier to use, but is not as powerful as StaticMatic. With Serve, all you need to do is install it (gem install serve) and type serve at the command line in the directory containing your Haml files. Then point your browser at http://localhost:4000. Full details here.

You can also hook-up Serve to make use of Compass the Sass meta-framework (which is awesome). There's a full tutorial here.

Charles Roper