This Emacs package provides a global minor mode that renders a preview of the buffer you are editing whenever you are idle for a couple of seconds. You can give an arbitrary shell command or Emacs Lisp function to render the preview. It can be different for each buffer.