Answer the question
In order to leave comments, you need to log in
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
}
Answer the question
In order to leave comments, you need to log in
grunt/gulp + configure watchers + build + livereload to make it very convenient.
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 questionAsk a Question
731 491 924 answers to any question