使用语法突出显示导出为 pdf/图像 - emacs
我在 Emacs 中打开了一个文件,该文件突出显示了语法,我想与另一个不使用 Emacs 的人共享该文件(具有语法突出显示)。
是否可以通过语法高亮导出在 Emacs 中打开的文件?
任何目标格式都可以:例如 HTML、PDF、图像
I have a file open in Emacs which highlights the syntax and I want to share the file (with syntax highlighting) with another person who does not use Emacs.
Is it possible to export the file open in Emacs with syntax highlightning?
Any target format is ok: e.g. HTML, PDF, Image
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用命令
Mx htmlfontify-buffer
从任何缓冲区创建带有语法突出显示的 html 文件。它包含在标准 Emacs 中,肯定是在版本 24 中,我不确定是否在版本 23 中。
You can use the command
M-x htmlfontify-buffer
to create an html file with syntax highlighting from any buffer.It's included in standard Emacs, definitely in version 24, I'm not sure about 23.
您可以使用“htmlize.el”附带的
htmlize-buffer
(在 http://fly.srk.fer.hr/~hniksic/emacs/htmlize.el.cgi (已死链接?) 或从 MELPA 安装或从 htmlize Github 项目。这将创建一个 HTML 文件,其中突出显示当前缓冲区的所有语法。You can use
htmlize-buffer
that comes with 'htmlize.el' (find it at http://fly.srk.fer.hr/~hniksic/emacs/htmlize.el.cgi (dead link?) or install from MELPA or download from the htmlize Github project. This will create a HTML file with all the syntax highlighting of your current buffer.