jupyter
This commit is contained in:
parent
24d895d100
commit
5ea47853ac
2
C/text.c
2
C/text.c
@ -845,7 +845,7 @@ bool Yap_CVT_Text(seq_tv_t *inp, seq_tv_t *out USES_REGS) {
|
|||||||
// cnt++;
|
// cnt++;
|
||||||
int l = push_text_stack();
|
int l = push_text_stack();
|
||||||
buf = Yap_readText(inp PASS_REGS);
|
buf = Yap_readText(inp PASS_REGS);
|
||||||
if (!buf) {
|
if (!buf || buf[0] == '\0') {
|
||||||
pop_text_stack(l);
|
pop_text_stack(l);
|
||||||
return 0L;
|
return 0L;
|
||||||
}
|
}
|
||||||
|
@ -1,18 +1,27 @@
|
|||||||
|
requirejs.config({
|
||||||
|
map: {
|
||||||
|
'*' : {
|
||||||
|
'codemirror/mode/prolog/prolog':'/kernelspecs/yap_kernel/prolog.js'
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
define([
|
define([
|
||||||
"/kernelspecs/yap_kernel/prolog.js"],function(CodeMirror){
|
'codemirror/lib/codemirror',
|
||||||
|
'base/js/namespace',
|
||||||
|
'base/js/events',
|
||||||
|
],function(Jupyter,events,CodeMirror){
|
||||||
var onload = function(){
|
var onload = function(){
|
||||||
console.log("I am being loaded");
|
var mode = {
|
||||||
var cell = Jupyter.notebook.get_selected_cell();
|
mime: "text/x-prolog",
|
||||||
var cm = cell.config;
|
name: "Prolog",
|
||||||
var patch = {
|
mode: "prolog",
|
||||||
CodeCell:{
|
ext: ["pl", "yap", "yss", "P"]
|
||||||
cm_config:{mode: "prolog"} // only change here.
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
config.update(patch);
|
//console.log("I am being loaded");
|
||||||
|
CodeMirror.requireMode("prolog", mode);
|
||||||
|
CodeMirror.setOption("mode",mode);
|
||||||
|
|
||||||
return {onload:onload};
|
return {onload:onload};
|
||||||
}
|
}});
|
||||||
}
|
|
||||||
);
|
|
||||||
|
@ -61,7 +61,7 @@ blankc('\n').
|
|||||||
blankc('\t').
|
blankc('\t').
|
||||||
|
|
||||||
enter_cell(_Self) :-
|
enter_cell(_Self) :-
|
||||||
%open('//python/sys.stdin', read, _Input, []),
|
open('//python/input', read, _Input, []),
|
||||||
open('//python/sys.stdout', append, _Output, []),
|
open('//python/sys.stdout', append, _Output, []),
|
||||||
open('//python/sys.stdout', append, _Error, []),
|
open('//python/sys.stdout', append, _Error, []),
|
||||||
%set_prolog_flag(user_input, _Input),
|
%set_prolog_flag(user_input, _Input),
|
||||||
|
Reference in New Issue
Block a user