Created
July 28, 2013 16:18
-
-
Save cades/6099153 to your computer and use it in GitHub Desktop.
Writing html in jade is nice, but I always forget to compile it.
Add this piece of code into your .emacs file, your emacs will compiles jade into html after save. 用 jade 寫 html 是件很棒的事, 但我老是忘記編譯它.
把這段 code 加入 .emacs, emacs 在存檔時會自動替你編譯.
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
;; auto compile jade file after save | |
(add-hook | |
'after-save-hook | |
(lambda () | |
(if (string= (file-name-extension (buffer-file-name)) "jade") | |
(if (= (shell-command | |
(concat "jade --pretty " (buffer-file-name))) | |
0) | |
(message (concat (buffer-file-name) " just saved and compiled into html")))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment