Oliver Angelil Oliver Angelil - 1 year ago 96
Jade Question

Compile .jade to .html in emacs

I'm using this mode in emacs for .jade files. The atom editor converts .jade files to .html when saving, I wonder if emacs can do the same thing?



Answer Source

Sure, just put this in your .emacs:

(defun compile-jade ()
  (when (eq major-mode 'jade-mode)
    (shell-command (format "jade %s" buffer-file-name))))

(add-hook 'after-save-hook 'compile-jade)