These are chat archives for ipython/ipython

5th
Apr 2015
Matthias Bussonnier
@Carreau
Apr 05 2015 00:43
@sccolbert You had questions ? I might be around half an hour today.
S. Chris Colbert
@sccolbert
Apr 05 2015 00:48
@Carreau yep - still here. can you ping me in a private gitter when you can?
Andrew Gibiansky
@gibiansky
Apr 05 2015 04:34
Hey all, I'm having some issues with code mirror and syntax highlighting. How do I make it so that my kernel correctly gets highlighted?
New cells all work properly, but if I load a notebook, by default it gets highlighted with the ipython mode...
I'm even looping over all cells, setting their mode, and telling them to highlight, but somewhere after kernel.js gets run their mode gets reset back to ipython
Matthias Bussonnier
@Carreau
Apr 05 2015 04:41
@gibiansky are you on 3.x ?
Andrew Gibiansky
@gibiansky
Apr 05 2015 04:41
Yes I am
Matthias Bussonnier
@Carreau
Apr 05 2015 04:41
if mode is correct on kernelspect, you shouldn't have anything to do in custom.js + mode.
Andrew Gibiansky
@gibiansky
Apr 05 2015 04:42
By 'mode' in kernelspec do you mean just the 'language' field
Matthias Bussonnier
@Carreau
Apr 05 2015 04:42
yes.
Andrew Gibiansky
@gibiansky
Apr 05 2015 04:42
What do I do if I need to define a custom CodeMirror mode, like IPython does?
Matthias Bussonnier
@Carreau
Apr 05 2015 04:42
Hum, ... I'm not sure about that.
Andrew Gibiansky
@gibiansky
Apr 05 2015 04:43
Should I have 'language' : 'ihaskell' and then define the codemirror mode 'ihaskell' in kernel.js?
Matthias Bussonnier
@Carreau
Apr 05 2015 04:43
I should check.
I'll open an issue to look tomorrow or on moday what's the best way to do it.
Andrew Gibiansky
@gibiansky
Apr 05 2015 04:43
Thanks.
Matthias Bussonnier
@Carreau
Apr 05 2015 04:45
done here: ipython/ipython#8257
Andrew Gibiansky
@gibiansky
Apr 05 2015 04:47
Thanks for looking into it. I seem to have solved my problem by looping over the cells and calling force_highlight on them, but would be nice to know what the official solution is so that I can simplify IHaskell JS.
Matthias Bussonnier
@Carreau
Apr 05 2015 04:50
Sure, and you might encounter issues we haven't though about.
Andrew Gibiansky
@gibiansky
Apr 05 2015 23:52
Is IPython 3.0 supposed to correctly highlight code in non-python notebooks? I am using a ipython nbconvert --to html --template basic to export an IHaskell notebook to HTML, and the code doesn't seem to highlight as Haskell. Do I need to pass any special arguments? (Googled around, checked docs, doesn't mention anything...)"