Skip to content

Instantly share code, notes, and snippets.

@esimov
Last active March 4, 2017 00:52
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save esimov/3898955 to your computer and use it in GitHub Desktop.
Save esimov/3898955 to your computer and use it in GitHub Desktop.
Sublime build for HAML->HTML automatic conversion
{
"cmd": ["haml"],
"working_dir": "${file_path:${folder}}",
"selector": "source.haml",
"file_regex": "(.*\\.ts?)\\s\\(([0-9]+)\\,([0-9]+)\\)\\:\\s(...*?)$",
"windows":
{
"cmd": ["haml", "--trace", "$file", "${file_base_name}.html"],
"shell": "true"
}
}
@robincsamuel
Copy link

This will not work with Automatic build system. You need to update that selector to text.haml
"selector": "text.haml"

Reference: http://stackoverflow.com/questions/27154136/build-haml-automatic-in-sublime-3-doesnt-work

@vulehuan
Copy link

vulehuan commented Mar 4, 2017

For Linux user:
$ cd ~/.config/sublime-text-3/Packages/User
create file "haml.sublime-build", paste the following code, save:
{
"cmd": ["haml", "-q", "$file", "${file_path}/${file_base_name}.html"],
"selector" : "text.haml"
}

http://docs.sublimetext.info/en/latest/reference/build_systems/configuration.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment