Re: [haml] Haml in Sublime Text 2 without Rails

859 views
Skip to first unread message

Duncan Beevers

unread,
Oct 4, 2012, 1:34:45 PM10/4/12
to ha...@googlegroups.com
I use guard for other purposes, but it looks like it might fit the bill.

I see there's already a set of guard tasks set up for compiling haml.
https://github.com/manufaktor/guard-haml

On Sun, Sep 30, 2012 at 3:27 PM, Hawk Phil <quan...@gmail.com> wrote:
> I am a front-end guy using Windows for design and html/js/css coding. My
> work is separate from the back-end guy using .NET. I am also new to
> Haml/Sass thing as well as Ruby. And definitely not using Rails. My goal is
> to make it simple when I save Haml file and refresh browser to see the Html
> file. So I am looking for either an automatic "watch" or build in a Build
> System batch for Sublime Text 2.
>
> I saw people mentioned a lot about StaticMatic. But there seems no update
> for 2 years https://github.com/staticmatic/staticmatic
>
> There is also this site (Is it the same?):
> http://staticmatic.rubyforge.org/how_to_use.html
>
> So is StaticMatic "safe" to use any more? Or should I just create a build
> file in Sublime Text for Haml CLI? Is there example to do this?
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Haml" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/haml/-/7Tjx59zaUEIJ.
> To post to this group, send email to ha...@googlegroups.com.
> To unsubscribe from this group, send email to
> haml+uns...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/haml?hl=en.

Rhett Sutphin

unread,
Oct 4, 2012, 2:25:39 PM10/4/12
to ha...@googlegroups.com
Hi,

On Sep 30, 2012, at 3:27 PM, Hawk Phil wrote:

> I am a front-end guy using Windows for design and html/js/css coding. My work is separate from the back-end guy using .NET. I am also new to Haml/Sass thing as well as Ruby. And definitely not using Rails. My goal is to make it simple when I save Haml file and refresh browser to see the Html file. So I am looking for either an automatic "watch" or build in a Build System batch for Sublime Text 2.
>
> I saw people mentioned a lot about StaticMatic. But there seems no update for 2 years https://github.com/staticmatic/staticmatic

The successor to StaticMatic is Middleman[1]. It has Haml and Sass support built in[2]. Also recommended: the middleman-livereload extension[3].

Rhett

[1]: http://middlemanapp.com/
[2]: http://middlemanapp.com/templates/templates-layouts-partials/ , under "Other Templating Languages"
[3]: http://middlemanapp.com/extensions/livereload/
Message has been deleted

Rhett Sutphin

unread,
Oct 27, 2012, 5:43:24 PM10/27/12
to ha...@googlegroups.com
Hi,

On Oct 25, 2012, at 2:18 AM, Hawk Phil wrote:

> There doesn't seem to be instructions to set things up for Sass and Haml. I just want to have Middleman to set a "watch" for .haml and .sass files and automatically detect changes to convert to .html and .css in certain folders. How do I do that?

Middleman doesn't provide this exact workflow. But for the way your originally described your problem ("My goal is to make it simple when I save Haml file and refresh browser to see the Html file."), it has a workflow that will work.

The idea is that you have a middleman project (which may contain files in lots of different template languages, including Haml and Sass). Then you run the middleman server. When your browser connects to the middleman server, Middleman arranges for the template to be executed and sends the result it to the browser. So, in this normal cycle, you never actually generate static HTML or CSS. (Middleman does have a command to generate static files also, but from your use case I don't think you need it.)

Middleman's getting started page[1] outlines the specific commands for executing this workflow.

Rhett

[1]: http://middlemanapp.com/getting-started/welcome/

>
> I am a non-Ruby person so sorry for this basic question. Thanks.
> To view this discussion on the web visit https://groups.google.com/d/msg/haml/-/MHdnFOo38qEJ.

Rhett Sutphin

unread,
Oct 28, 2012, 12:42:27 AM10/28/12
to ha...@googlegroups.com
Hi,

On Oct 27, 2012, at 7:35 PM, Hoc Phan wrote:

> Are you saying that when I go to localhost:port/file.html, it automatically executes a build process before render the page?

That's right, that's what middleman server does out of the box. Try it and see.

For an even nicer workflow, you can use the middleman-livereload plugin I mentioned in my original message. When that plugin is part of your middleman project and you have a page from your project open in a relatively modern browser, the page will automatically be reloaded when you save any of the source files.

Rhett
> To view this discussion on the web visit https://groups.google.com/d/msg/haml/-/59Z1tpDSYCoJ.

Hoc Phan

unread,
Nov 8, 2012, 3:00:32 AM11/8/12
to ha...@googlegroups.com
Thanks. You are right. I have been testing it since last several days. Pretty stable and nice system...
Reply all
Reply to author
Forward
0 new messages