Render Markdown in Emacs buffer

前端 未结 8 624
一个人的身影
一个人的身影 2021-01-30 06:27

Is it possible to present Markdown rendered in an Emacs buffer using Emacs\' own buffer text formatting capabilities? Emacs in graphical environments has rich text presentation

8条回答
  •  闹比i
    闹比i (楼主)
    2021-01-30 07:24

    Personally, I use the following workflow:

    • run on a C-c C-c m to run Mark­down on the cur­rent buffer and pre­view the out­put in an­other buffer.
    • move to html-mode on this other buffer (M-x html-mode)
    • hide the html tags to display something close to the output (M-x sgml-tags-invisible)

    Then every time you want to refresh the rendering, simply run again C-c C-c m on the markdown buffer.

    Yet I confess until now for Markdown editing/previewing, nothing beats for me Textmate and its markdown preview panel. Actually, from a personal perspective, the only case where I prefer to run Textmate rather than Emacs is when I want to edit markdown files. Yet the path to have the same quality of preview on emacs is not so difficult and probably I should investigate it. As I see it, it's simply:

    • get the internal css used by Textmate for rendering the preview
    • use w3 or w3m to preview the markdown output using this css

提交回复
热议问题