I just finished building the new version of an old project, Codr.cc.
It allows you to store, share, or broadcast notes or code. You can drag-and-drop files onto it. I took a lot from notepad.cc in the way it saves automatically to the server. Append '/extension' to your links to activate real-time syntax highlighting, currently supporting:
js, html, css, php, c, cpp, java, py, haskell, smalltalk, and stex (I should list that somewhere...)
Each file has a public link you can share from where the file cannot be edited.
Changes to the file can bee seen in really real time from either end of the (non-public) url.
I can't provide a concrete answer since I have to write new parsers myself, and I'm not familiar with scala. However, if I see the project take off in any significan way, I will dedicate some time to adding support for more languages :)
That reminds me that I should put some contact info up on the site somewhere...
Could you have an extension of /preview or /render that would render the page live on the broadcast side. This would be great for teaching/demos. Even better if they can switch between code/render view.
HTML is the easy part, but maybe consider extending it like http://ideone.com/ an online compile service. Or maybe combine it though i am not sure if ideone.com offers an API.
There have been a few of these made — I remember ethercodes, which probably came closest to replicating what this is doing.
Right now, as a collaborative editing tool, it doesn't really work, since you can't have two people focused on different lines at once (I just experienced fighting over the focus with a co-worker).
On the read-only version of the page, placing the cursor and hitting "enter" adds newlines. They don't show up in anyone else's session AFAICT, but it's a little disconcerting to get the impression of editing what was supposed to be a read-only document :)
Very, very nice!
This is going to replace Etherpad for us when interviewing.
Thank you for building this.
Some notes:
* Tab defaults to 8 spaces. Ughh, can it be 4?
* Auto-formatting uses offsets of 2 spaces. Why? Either turn it off or use 4 (not everyone is a Rubbyist and even not all Rubbyists adhere to this convention)
I really like the idea and implementation. Its pretty neat for collaborative code editing and much better for editing code then etherpad or google docs. I think this should be the main focus. I think i will use it primarily to discuss and develop code with other ppl.
But I won't use it for a pastebin as i really love http://paste.pocoo.org/ which supports syntax highlighting for many languages, an api to upload files, great python commandline util, support for multiple files with different syntax highlights in one paste etc. JFTR the most important thing for me to use codr.cc as a pastebin would be an api/commandline util and more languages
And thanks for the bonus of making this work on the iPad. It's one of the first things I do when I come across a new browser-based editor. It has a few quirks, but definitely usable. (I found that I had to display the page pull-down info panel to trick the iPad keyboard to show. As an aside, I wonder if there's a bookmarklet to force out the iPad keyboard. Or a bookmarklet to fake tabs.)
Indeed, markdown, textile, and many other languages would make a nice addition. I'll be adding support for more and more languages as I see the project growing.
Woah, I'm honored to have something meet one of my projects! This is pretty neat.
I've thought about syntax highlighting and some other interesting ideas on notepad.cc. Currently, if you add a + to the end of any URL, the font turns monospace.
* Opened page in new tab, switched to tab after reading a few other things.
* Saw a url in the drop-down at the top, different to url of page, briefly pondered whether I should go to that instead.
* Decided to copy/paste and go there.
* Couldn't type in editor, closed tab thinking it didn't work in Chrome on OSX.
Now it's a holiday in the UK, and sunny too amazingly, so I'm just quickly flicking through items of interest but people generally don't read what you put in front of them. I've read through the comments now and, while one anecdote isn't data, you may want to think about how you present the write-version/read-only-version URLs.
The url from the dropdown is a url you can share from where no edits can be made. For example, for sharing code on twitter, or broadcasting it (any changes from the main url are still seen in real time).
I think the searching and categorizing could be public, but perhaps pro users could get eclipse/textmate/whatever plugin + api access to do some automatic stuff. You could have it do a search on the current empty method name and return any similar-sounding snippets in the current language, ready for embedding and sourcing, complete with comments.
You could even have a special kind of in-source comment that links the snippet to the web URL so you can track changes and automatically show the differences and "accept" the changes to your source code. New way to collaborate :)
Those are some very interesting ideas, I especially find the similar snippet lookup thing.
However, for that particular one a more robust database of snippets would probably be necessary, and it would take a long amount of time to gather enough snippets for it to be really useful.
As to some of the other features, I think they go beyond the scope of the project. The premise of codr.cc is to allow you to share code (live or not) using a simpler interface than all the other pastebins out there. That's why I took all of the features that might go a bit beyond that and labeled them pro.
However, I very much like the idea of an API and local plugins. Stuff like a command-line interface etc. would be very interesting :)
I like it, but I would personally recommend locking on a line level. I shouldn't be able to hold backspace on the same line my collaborators are editing IMO. Another added bonus would be to do a very faint row level highlight to show where other contributors are. Lastly, just to show a list of the current page contributors.
For line (row) level locking, add handling to only allow one user to edit a particular line at a time.
For each user currently on the page, assign them a discreet palette color. Highlight the current line each user is on with their color to give indication to all other users what line everyone else is on/modifying.
Have a sidebar (collapsible/expandable) on the page that shows all given users on the current page, along with their personal color. This lets you associate live edits to a particular user. This would function much the same as using Google Docs (i.e. spreadsheets).
I shouldn't be able to hold backspace on the same line my collaborators are editing IMO. Another added bonus would be to do a very faint row level highlight to show where other contributors are. Lastly, just to show a list of the current page contributors.
Have you thought about integrating/leveraging Ace (previously SkyWriter, Bespin)? http://ace.ajax.org/
This would give you the ability to let people use emacs/vim shortcuts among a lot of other not-reinventing-the-wheel kind of things (like better syntax highlighting).
I have, and originally intended to. However, I went with something a bit simpler to implement to start with, as I haven't played with ACE in any significant way and I built this over the weekend.
It's definitely something I would consider to support.
- Funny you should say, I'm actually on OS X Chrome and I don't find it all that choppy. Could you elaborate on that?
- You're probably right.
- I figured the root url (codr.cc) serves as a new pastebin button.
- As I mentioned in another comment, I have to write new code engines by myself, which is a bit harder with languages I'm not familiar with. However, if I see the project take off, I will put some time into supporting more and more languages.
You could also add basic Forth support very easily. In Forth, everything is composed of whitespace-delimited tokens. A token is either an integer or a word. Forth uses metaprogramming to make the syntax extensible, but the most common words with special syntax are comments and string constants.
\ is a single-line comment that skips until the next newline, ( is a multiline comment that skips until the next end paren, ." is an inline print string that scans until the next quote, and it has a counterpart .s" string constant that works the same. Bingo, one basic Forth tokenizer!
There's a great manual for GForth[1], in case you're curious to see what some code looks like or give the language a spin.
Lisp has some of the easist syntax there is (only other contender is whitespace).
(function-call
(+ 5 4)
9
"Hello I like your service"
`(this is read as a list of keywords rather than as a call to the function this with the rest as arguments ,the-value-of-me-is-inserted-due-to-the-comma this-keyword-is-not-changed))
This is exactly what I had in mind when I started working on http://collabde.appspot.com/ I used codemirror with mobwrite and appengine channel api. It currently works only for python though.
I have one problem with it though, is that everyone's cursor appears to jump to the same spot when someone makes a change. This makes it somewhat impossible for multiple authors of one file.
You're right. Coding at 4am affects my grammar :-p
Not that complex. It could be better, but for now I make sure everyone is on the same page by ensuring that the cursor is at the same location at all times.
I've yet to implement multiple cursors, but it's something I definitely want to do.
Tangential Question: Is is possible to allow Chrome to modify files on the local hd? I'd love to use a web-based editor like this for many things I do.
It takes a security-through-obscurity approach, using random url's. The pro version, if enough demand, would include a private namespace with individual password protection for each file.
You should've used the standard scrolling. Search doesn't work if the text is not in the current view. So you can only really search what's on the current page.
It allows you to store, share, or broadcast notes or code. You can drag-and-drop files onto it. I took a lot from notepad.cc in the way it saves automatically to the server. Append '/extension' to your links to activate real-time syntax highlighting, currently supporting:
js, html, css, php, c, cpp, java, py, haskell, smalltalk, and stex (I should list that somewhere...)
Each file has a public link you can share from where the file cannot be edited.
Changes to the file can bee seen in really real time from either end of the (non-public) url.
And all with a really nice interface to boot!
Let me know what you think :)