mirror of
https://github.com/IHaskell/IHaskell.git
synced 2025-04-16 03:16:20 +00:00
fixing python3 bug and weird highlighting bug
This commit is contained in:
parent
b3d741fdc2
commit
7846000e0a
@ -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() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user