是否有代码编辑器允许将语法突出显示复制到 Windows 的 Office 文档?

发布于 2025-01-08 14:46:45 字数 220 浏览 1 评论 0原文

是否有代码编辑器允许将语法突出显示复制到 Windows 的 Office 文档?

我希望能够将代码复制到 Word 文档或电子邮件中,并在解释代码更改时保留格式。

我需要多种语言的支持,包括 C、C++、TCL、Javascript、Basic 和其他语言。

包含行号以供参考的能力将是一个很好的附加功能。我的一位客户要求在 Word 或 PDF 文档中提交所有代码以及行号。

Is there a code editor that will allow copying of syntax highlighting to an Office Document for Windows?

I want to be able to copy code into a Word doc or EMail and preserve the Formatting when explaing code changes.

I will need support for multiple languages including C, C++, TCL, Javascript, Basic, and couple others.

The ability to include the line numbers for reference purposes would be a nice additional feature. I had one customer that required all code to be submitted with line numbers in a Word or PDF document.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(3

少女的英雄梦 2025-01-15 14:46:45

我过去使用Notepad++。它有一个名为 NppExport 的插件,我认为它拥有您需要的一切。问题是您必须使用 Notepad++ 编写/打开源文件,然后将它们导出到 rtf,打开 rtf 并将格式漂亮的文本复制到您的文档文件中。
以下是 Notepad++一篇很好的文章,帮助您开始使用 NppExport 插件。

I used Notepad++ in the past. It has a plug-in called NppExport and I think it has everything you need. The catch is that you have to write/open your source files with Notepad++, then export them to rtf, open the rtf and copy the pretty-formatted text to your doc file.
Here is the link to Notepad++ and to a good article to get you started with NppExport plugin.

以歌曲疗慰 2025-01-15 14:46:45

Visual Studio (2010 Professional) 在将代码和格式/着色复制到 MS Word (2010) 和 Outlook (2010)* 时“工作正常”。它至少支持 C/C++/C# 和 JavaScript 代码。它可能支持TCL/BASIC(它确实支持VB/VB.NET),但我不使用这些语言。当然,VS 是一个成熟的 IDE。

Visual Studio 2010 Express 是免费的(就像啤酒一样) 。但由于我的公司为我的副本付费,我只能希望 Express 中也能提供复制粘贴支持;-) 无论如何,这可能值得一试。

我不确定是否可以通过复制粘贴导出行号,但我对此表示怀疑。这不是我遇到过的用例。

就我个人而言,我建议通过 SCM/代码审查流程进行审查,而不是手动进行审查,这听起来像是一场噩梦。使用为此目的设计的工具还有其他优点,包括历史管理和讨论真实情况或可能情况(与过去相关),而不是可能情况的副本。

快乐编码。


*粘贴到 Microsoft Word 后,禁用“在每个段落后添加空格”选项,以从粘贴的代码中删除看似空白的行。

Visual Studio (2010 Professional) "works fine" for copying code and formatting/coloring to MS Word (2010) and Outlook (2010)*. It supports at least C/C++/C#, and JavaScript code. It might support TCL/BASIC (it does support VB/VB.NET), but I do not use those languages. And, of course, VS is a full-blown IDE.

Visual Studio 2010 Express is free (as in beer). But as my company pays for my copy, I can only hope the copy'n'paste support works in Express as well ;-) In any case, it might be worth a try.

I am not sure if line-numbers can be exported via copy'n'paste, but I sort of doubt it. It's not a use-case I've run into.

Personally, I'd recommend doing the review via a SCM/code-review process and not manually, which just sounds like a nightmare. There are additional advantages of using tooling designed for this purpose including history management and talking about what really is, or could be (in relation to what was), and not a copy of what might have been.

Happy coding.


*After pasting into Microsoft Word, disable the "Add space after every paragraph" option to remove what appears to be blank lines from the pasted code.

怎樣才叫好 2025-01-15 14:46:45

如果您安装了所有所需语言的语言支持,Eclipse 就可以了。

Eclipse will do fine if you install the language support for all the wanted languages.

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