Ask Your Question
1

Sage notebook color codes code

asked 2011-10-24 16:42:57 +0200

G-Sage gravatar image

updated 2012-11-15 12:42:13 +0200

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.${}$

edit retag flag offensive close merge delete

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 ( 2011-10-24 17:58:16 +0200 )edit
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 ( 2011-10-25 10:52:00 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2011-10-25 11:37:44 +0200

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.

edit flag offensive delete link more

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: 2011-10-24 16:42:57 +0200

Seen: 975 times

Last updated: Nov 15 '12