Mar*_*ann 47 emacs markdown elisp
是否可以使用Emacs自己的缓冲区文本格式化功能在Emacs缓冲区中呈现Markdown?图形环境中的Emacs具有丰富的文本显示功能(字体样式,颜色,链接甚至图像),因此它应该是非常可能的.有没有现有的实施?
请注意,我们的想法是将呈现的Markdown设置为本机Emacs格式的文本,可以像在Emacs中的任何其他文本一样进行导航和操作.因此,这里不希望呈现嵌入在Emacs缓冲区中的图像的解决方案.
另请注意,这不是用于编辑 Markdown 的模式,而是用于在Emacs缓冲区中呈现呈现的Markdown.它最好是一个纯Emacs Lisp解决方案,便于携带.
Seb*_*tte 21
Personnaly,我使用以下工作流程:
C-c C-c m
上运行以在当前缓冲区上运行Markdown并在另一个缓冲区中预览输出.html-mode
这个其他缓冲区(M-x html-mode
)M-x sgml-tags-invisible
)然后,每次要刷新渲染时,只需C-c C-c m
在markdown缓冲区上再次运行.
然而我承认直到现在为Markdown编辑/预览,没有什么比我Textmate及其降价预览面板更好.实际上,从个人的角度来看,我喜欢运行Textmate而不是Emacs的唯一情况是我想要编辑markdown文件.然而,在emacs上具有相同的预览质量的路径并不是那么困难,我可能应该对其进行调查.在我看来,它只是:
我想你可以使用latex-preview的源代码获取灵感或者漂亮的lambda(一个更简单的软件).
或者,您可以在后台进程中将markdown转换为html并预览html.
在Emacs中一切皆有可能,但并非一切都很容易实现:-)
我在.emacs文件中有这个:
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(markdown-header-delimiter-face ((t (:inherit font-lock-function-name-face :underline t :weight bold))) t)
'(markdown-header-face-1 ((t (:inherit markdown-header-face :height 1.5))) t)
'(markdown-header-face-2 ((t (:inherit markdown-header-face :height 1.3))) t)
'(markdown-header-face-3 ((t (:inherit markdown-header-face :underline t :height 1.2))) t)
'(markdown-header-face-4 ((t (:inherit markdown-header-face :underline t :height 1.1))) t)
'(markdown-header-face-5 ((t (:inherit markdown-header-face :underline t))) t)
'(markdown-header-face-6 ((t (:inherit markdown-header-face :underline t))) t))
(put 'set-goal-column 'disabled nil)
Run Code Online (Sandbox Code Playgroud)
这扩大了所有头条新闻.Markdown-mode本身将斜体显示已加星标的文本和粗体双色标题文本,因此这将使您获得.但是,它不会使控制字符不可见.
如果你想要那个,你应该看看漂亮的lambda例子(如Bozhidar Batsov建议的那样)
归档时间: |
|
查看次数: |
10412 次 |
最近记录: |