Commit 7846000e authored by Andrew Gibiansky's avatar Andrew Gibiansky

fixing python3 bug and weird highlighting bug

parent b3d741fd
......@@ -2,8 +2,8 @@
# exe: Path to IHaskell kernel.
c = get_config()
c.KernelManager.kernel_cmd = [exe, 'kernel', '{connection_file}']
c.Session.key = ''
c.Session.keyfile = ''
c.Session.key = b''
c.Session.keyfile = b''
# Syntax highlight properly in Haskell notebooks.
c.NbConvertBase.default_language = "haskell"
......@@ -53,7 +53,7 @@ $([IPython.events]).on('notebook_loaded.Notebook', function(){
// add here logic that should be run once per **notebook load**
// (!= page load), like restarting a checkpoint
var md = IPython.notebook.metadata
var md = IPython.notebook.metadata;
if(md.language){
console.log('language already defined and is :', md.language);
} else {
......@@ -71,14 +71,21 @@ $([IPython.events]).on('app_initialized.NotebookApp', function(){
cells = IPython.notebook.get_cells();
for(var i in cells){
c = cells[i];
if (c.cell_type === 'code'){
if (c.cell_type === 'code') {
// Force the mode to be Haskell
// This is necessary, otherwise sometimes highlighting just doesn't happen.
// This may be an IPython bug.
c.code_mirror.setOption('mode', 'haskell');
c.auto_highlight()
}
}
})
// We can only load the conceal scripts once all cells have mode 'haskell'
require(['/static/custom/conceal/conceal.js']);
});
IPython.CodeCell.options_default['cm_config']['mode'] = 'haskell';
require(['/static/custom/conceal/conceal.js']);
});
var highlightCodes = function() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment