fixing python3 bug and weird highlighting bug

This commit is contained in:
Andrew Gibiansky 2014-01-03 20:22:29 -05:00
parent b3d741fdc2
commit 7846000e0a
2 changed files with 13 additions and 6 deletions

View File

@ -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"

View File

@ -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() {