在emacs中将.jade编译为.html

时间:2016-07-09 02:56:18

标签: html emacs pug

我在emacs中使用this模式来获取.jade文件。原子编辑器在保存时将.jade文件转换为.html,我想知道emacs是否可以做同样的事情?

谢谢,

奥利弗

1 个答案:

答案 0 :(得分:1)

当然,只需将其放入.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)