Processing math: 100%

First time here? Check out the FAQ!

Ask Your Question
1

Sage notebook color codes code

asked 13 years ago

G-Sage gravatar image

updated 12 years ago

So, nice programming environments color code code... including this website here

for i in [1..100]:
    print i

Sage Notebook should do the same! It makes it a lot easier to read, obviously.

Preview: (hide)

Comments

1

I think that people have tried to implement different syntax highlighting packages in the notebook, and they were all too slow.

John Palmieri gravatar imageJohn Palmieri ( 13 years ago )
1

This looks like it would be an excellent option: [ACE](http://ace.ajax.org/). I would love to have VIM keybindings when working in Sage. Looks like there are [native methods for transforming textareas](http://groups.google.com/group/ace-discuss/browse_thread/thread/01480dcd06c88efd).

process91 gravatar imageprocess91 ( 13 years ago )

1 Answer

Sort by » oldest newest most voted
2

answered 13 years ago

Jason Grout gravatar image

We have experimented with CodeMirror and several other solutions. In fact, Sage includes CodeMirror version 1 as the editor for DATA python files. In the single-cell server, we use CodeMirror 2. CodeMirror is a very lightweight version of the same sorts of ideas as ACE.

John is right. Not only have the options been too slow once you have lots of cells, but the options for syntax highlighting don't work perfectly across all browsers. Good ol' textareas do work across browsers. However, the last time we really tested switching the default cells was several years ago (before ACE and CodeMirror 2, for example). It would probably be good to try again and see if browsers and editor widgets are up to speed now. So: feel free to experiment with switching the cell types and reporting your results. I'd suggest trying CodeMirror 2 first, and if that doesn't work, trying ACE.

Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 13 years ago

Seen: 1,359 times

Last updated: Nov 15 '12