ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 25 Oct 2011 04:37:44 -0500Sage notebook color codes codehttp://ask.sagemath.org/question/8413/sage-notebook-color-codes-code/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.${}$Mon, 24 Oct 2011 09:42:57 -0500http://ask.sagemath.org/question/8413/sage-notebook-color-codes-code/Comment by John Palmieri for <p>So, nice programming environments color code code... including this website here</p>
<pre><code>for i in [1..100]:
print i
</code></pre>
<p>Sage Notebook should do the same! It makes it a lot easier to read, obviously.${}$</p>
http://ask.sagemath.org/question/8413/sage-notebook-color-codes-code/?comment=21046#post-id-21046I think that people have tried to implement different syntax highlighting packages in the notebook, and they were all too slow.Mon, 24 Oct 2011 10:58:16 -0500http://ask.sagemath.org/question/8413/sage-notebook-color-codes-code/?comment=21046#post-id-21046Comment by process91 for <p>So, nice programming environments color code code... including this website here</p>
<pre><code>for i in [1..100]:
print i
</code></pre>
<p>Sage Notebook should do the same! It makes it a lot easier to read, obviously.${}$</p>
http://ask.sagemath.org/question/8413/sage-notebook-color-codes-code/?comment=21038#post-id-21038This 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).Tue, 25 Oct 2011 03:52:00 -0500http://ask.sagemath.org/question/8413/sage-notebook-color-codes-code/?comment=21038#post-id-21038Answer by Jason Grout for <p>So, nice programming environments color code code... including this website here</p>
<pre><code>for i in [1..100]:
print i
</code></pre>
<p>Sage Notebook should do the same! It makes it a lot easier to read, obviously.${}$</p>
http://ask.sagemath.org/question/8413/sage-notebook-color-codes-code/?answer=12812#post-id-12812We 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](http://sagemath.org:5467), 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.Tue, 25 Oct 2011 04:37:44 -0500http://ask.sagemath.org/question/8413/sage-notebook-color-codes-code/?answer=12812#post-id-12812