A
A
Alex Space2014-06-05 11:23:03
HTML
Alex Space, 2014-06-05 11:23:03

How to implement automatic compilation of Haml to HTML in Sublime text 2?

Hello! I work on Windows 7 and use Sublime text 2. Recently I became interested in the Haml language - I learned it, installed it, felt it ... but I can't figure out how to use it effectively. Every time I save a document, in order to see the changes on the site, I have to constantly type in the terminal: haml index.haml index.html
Naturally, I do this action very often and it gets pretty annoying. You need to somehow set up automatic compilation from Haml to HTML. Can anyone please tell me how this is done?
The bourgeoisie recommends a plugin for sublime text 2 - SublimeOnSaveBuild to solve this problem . It allows you to bind any trigger to saving the document. You can, for example, bind Haml compilation to HTML. To make it work, you need to add this code to the settings of this plugin:

{
    "filename_filter": "\\.(css|js|sass|less|scss|jade|haml)$",
    "build_on_save": 1
}

I finished it, but I don't understand what to do next.
If anyone worked with him, please explain what is needed for him to start working as planned?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2014-06-05
@MrSpace

grunt/gulp + configure watchers + build + livereload to make it very convenient.

M
Mikhail Shevtsov, 2018-09-01
@Lobotomy

If suddenly someone else needs it, there is an easier option, without using grunt / gulp and generally node.js. The author only needed to configure the Build System for HAML, and this is done by creating a single file:

{
  "cmd": ["haml", "$file", "$file_base_name.html"],
  "file_patterns": ["*.haml"],
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question