使用语法突出显示导出为 pdf/图像 - emacs

发布于 2024-12-18 18:29:21 字数 139 浏览 5 评论 0原文

我在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

╭ゆ眷念 2024-12-25 18:29:21

您可以使用命令 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.

情域 2024-12-25 18:29:21

您可以使用“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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文