Oliver Angelil
Oliver Angelil

Reputation: 1284

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?

Thanks,

Oliver

Upvotes: 1

Views: 156

Answers (1)

Brian Malehorn
Brian Malehorn

Reputation: 2685

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)

Upvotes: 1

Related Questions