Created
April 28, 2015 08:29
-
-
Save pingany/3ff41e2a7852db5886d3 to your computer and use it in GitHub Desktop.
A sublime text 2 (should be ok on 3, not tested) plugin, to convert jade file to html file when save
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sublime, sublime_plugin,os | |
| class JadeToHtmlOnSave(sublime_plugin.EventListener): | |
| def on_post_save(self, view): | |
| print 'JadeToHtmlOnSave: on_post_save' | |
| folder = view.window().folders()[0] | |
| os.chdir(folder) | |
| filename = os.path.basename(view.file_name()) | |
| if filename.endswith('.jade') == 1: | |
| view.window().run_command('exec',{'cmd':['jade', filename],'working_dir':folder}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment