views:

123

answers:

1

Good morning,

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/

+2  A: 

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

UPDATE: See http://ethercodes.com/ (23h old site) where Garry Yao has implemented code highlighting! You have to open Pad options and choose your language -- the example you get pre-filled is JavaScript. Also notice the command line just below the editable area - type help to get details on it. EtherCodes is alpha, so pinning the command line didn't work for me, but try set minConsoleHeight 80 (tab completion!) for a good workaround.

Simon B.
That's a bit silly. Why not do the syntax highlighting 100% client-side?
Martindale
@Martindale, yes you'd better stay away from server side and DB-storing of formatting.
Simon B.