How to turn on syntax highlighting in etherpad
Asked Answered
C

3

10

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/

Chadchadabe answered 5/8, 2010 at 11:52 Comment(0)
D
6

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

Disorganization answered 11/8, 2010 at 17:24 Comment(3)
That's a bit silly. Why not do the syntax highlighting 100% client-side?Alexandretta
@Martindale, yes you'd better stay away from server side and DB-storing of formatting.Disorganization
This answer no longer represents Etherpad's current status. Syntax highlighting is very much now available in Etherpad as a plugin. Also see codepad.etherpad.orgChiton
S
10

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

Shogun answered 19/4, 2012 at 9:34 Comment(3)
Looks interesting, but I don't have my own etherpad installation. I was looking something that I can use as easily as the etherpads.Chadchadabe
@MartinPreusse you can easily just deploy your own Etherpad instance, see etherpad.orgChiton
'Syntax' no longer returns anything in the plugin search :(Yodel
D
6

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

Disorganization answered 11/8, 2010 at 17:24 Comment(3)
That's a bit silly. Why not do the syntax highlighting 100% client-side?Alexandretta
@Martindale, yes you'd better stay away from server side and DB-storing of formatting.Disorganization
This answer no longer represents Etherpad's current status. Syntax highlighting is very much now available in Etherpad as a plugin. Also see codepad.etherpad.orgChiton
S
1

The etherpad plugin ep_codepad provides syntax highlighting - based on highlight.js - for etherpad.

https://www.npmjs.com/package/ep_codepad

Survive answered 1/7, 2015 at 15:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.