如何在 etherpad 中打开语法突出显示
自从开源以来,有许多免费的 etherpad 实现。 etherpad 是否支持语法突出显示或者是否有某种附加组件可用?
我试过 http://typewith.me/ http://sync.in/ http://www.piratenpad.de/
There are many free etherpad implementations since it went open source. Does etherpad support syntax highlighting or is some kind of add-on available?
I tried
http://typewith.me/
http://sync.in/
http://www.piratenpad.de/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以在 Etherpad 中安装一个名为“语法高亮”的插件。
要安装插件,只需访问 Etherpad 部署上的 /admin/plugins,然后搜索“语法”并单击安装。
有关该插件的详细信息,请参阅 https://npmjs.org/package/ep_syntaxhighlighting
You can install a plugin in Etherpad called "Syntax highlighting".
To install the plugin simple visit /admin/plugins on your Etherpad deployment and then search for "syntax" and click Install.
For details on the plugin see https://npmjs.org/package/ep_syntaxhighlighting
更新:语法突出显示可作为当前 Etherpad 中的插件使用 - 请参阅下面约翰的回答。
最初的 etherpad 创建者正在致力于突出显示,但复杂的同步问题使他们放弃了该功能 - 正如源代码中的 .txt 文件中记录的那样。
许多 etherpad 站点都在大多数标准的 etherpad.org 版本上运行。如果添加突出显示,您可能会看到它很快在 sketchpad.cc 中被采用。也许观察他们并等待?或者,如果您确实想要突出显示,那么只读视图就是一个很好的第一次尝试/实验。示例: http://sketchpad.cc/sp/pad/view/BACfNDybki/latest< /a>
尝试使用一些现有的突出显示 javascript 库来突出显示 DIV#padcontent 或 $('DIV#padcontent')[0].textContent 中的文本。
复杂性是将突出显示的文本格式返回到数据库中。为此,您可能需要使用操作转换(这是 etherpad 的基础,最近也用于 Google Docs 文字处理器)。教程:http://www.codecommit.com/blog /java/理解和应用操作转换
UPDATE: Syntax highlighting is available as a plugin in the current Etherpad -- see John's answer below.
The original etherpad creators were working on highlighting, but complex sync-problems made them abandon that feature -- as documented in a .txt file in the source code.
Many etherpad sites run on a mostly standard etherpad.org release. If highlighting would get added, you'd probably see it quickly adopted at sketchpad.cc. Perhaps watch them and wait? Or if you really want highlighting, a good first attempt/experiment would be the read-only view. Example: http://sketchpad.cc/sp/pad/view/BACfNDybki/latest
Try to use some existing highlighting javascript library to highlight the text inside DIV#padcontent or perhaps $('DIV#padcontent')[0].textContent
The complexity is getting the highlighted text formatting back into the DB. For this you might need to use operational transformations (which is the foundations of etherpad and as of recently also used in the Google Docs word processor). A tutorial: http://www.codecommit.com/blog/java/understanding-and-applying-operational-transformation
etherpad 插件 ep_codepad 为 etherpad 提供语法突出显示 - 基于highlight.js。
https://www.npmjs.com/package/ep_codepad
The etherpad plugin ep_codepad provides syntax highlighting - based on highlight.js - for etherpad.
https://www.npmjs.com/package/ep_codepad