Skip to content

Instantly share code, notes, and snippets.

@cades
Created July 28, 2013 16:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cades/6099153 to your computer and use it in GitHub Desktop.
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 在存檔時會自動替你編譯.
;; 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