Skip to content
/ snucode Public

A realtime collaborative text editor with syntax highlighting using websockets via the Socketstream (Node.js) library

Notifications You must be signed in to change notification settings

werg/snucode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

snucode

snucode is a basic realtime-collaborative text editor with syntax highlighting. Check out the live demo at snucode.com

Contact me: @werg

Dependencies

snucode uses the Node.js websockets framework SocketStream (v 0.2 for now), and the syntax-highlighted editor CodeMirror as well as a bit of Backbone.js for MVC structure on the client side.

Features

  • Arbitrarily many authors can edit the same file simultaneously.
  • All syntax-highlighting modes CodeMirror provides are supported,
  • as well as most of the visual themes.
  • Author attribution is done by decorating text with color-coded underlining.
  • Open files from local file system using the HTML 5 File API.
  • Tries to guess filetype from file extension or MIME type.
  • Line Wrapping optional.
  • Save files to disk using Douglas Neiner's Downloadify (uses Flash since there's no reliable HTML 5 solution).
  • Documents expire a set amount of time after last access (default two weeks, using Redis expire).

For bugs or feature requests please either send me a tweet or raise an issue on github.

Install

To roll your own copy, install Node.js and SocketStream at version 0.2 (which currently still should be default version available on npm). To test it simply run socketstream start

And head to 0.0.0.0:3000.

Operational Transformation

I chose a rather simplifying and (to my mind elegant) approach to operational transformation (i.e. making sure that concurrent edits get integrated at the right place in the document). You can read up on it at my weblog.

License

Copyright (c) 2012 Gabriel Pickard

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

A realtime collaborative text editor with syntax highlighting using websockets via the Socketstream (Node.js) library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published