Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gargantext-ihaskell
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
gargantext-ihaskell
Commits
ec3287f6
Commit
ec3287f6
authored
Mar 18, 2014
by
Andrew Gibiansky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Completed parsec integration!
parent
ddc8f623
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
widget.html
ihaskell-display/ihaskell-parsec/widget.html
+4
-0
Test.ipynb
notebooks/Test.ipynb
+14
-2
No files found.
ihaskell-display/ihaskell-parsec/widget.html
View file @
ec3287f6
...
...
@@ -4,10 +4,14 @@
<!-- Parsec widget -->
<script>
// Only load this script once.
var
kernel
=
IPython
.
notebook
.
kernel
;
var
initialized
=
kernel
!==
undefined
&&
kernel
!=
null
;
if
(
initialized
&&
window
.
parsecWidgetRegistered
===
undefined
)
{
// Do not load this script again.
window
.
parsecWidgetRegistered
=
true
;
// Register the comm target.
var
ParsecWidget
=
function
(
comm
)
{
this
.
comm
=
comm
;
...
...
notebooks/Test.ipynb
View file @
ec3287f6
...
...
@@ -40,7 +40,7 @@
" float = do\n",
" value <- many1 $ oneOf \"0123456789\"\n",
" char '.'\n",
" after <- many $ oneOf \"0123456789\"\n",
" after <- many
1
$ oneOf \"0123456789\"\n",
" optional $ char ','\n",
" whitespace\n",
" return (read (value ++ \".\" ++ after) :: Float)\n",
...
...
@@ -70,10 +70,14 @@
"\n",
"<!-- Parsec widget -->\n",
"<script>\n",
"// Only load this script once.\n",
"var kernel = IPython.notebook.kernel;\n",
"var initialized = kernel !== undefined && kernel != null;\n",
"if (initialized && window.parsecWidgetRegistered === undefined) {\n",
"\n",
"// Do not load this script again.\n",
"window.parsecWidgetRegistered = true;\n",
"\n",
"// Register the comm target.\n",
"var ParsecWidget = function (comm) {\n",
" this.comm = comm;\n",
...
...
@@ -121,11 +125,13 @@
" // Update every key press.\n",
" editor.on(\"keyup\", function() {\n",
" var text = editor.getDoc().getValue();\n",
" console.log(\"Sent\",text); \n",
" comm.send({\"text\": text});\n",
" });\n",
"};\n",
"\n",
"ParsecWidget.prototype.handler = function(msg) {\n",
" console.log(\"Handler\", msg); \n",
" var data = msg.content.data;\n",
" this.hasError = data[\"status\"] == \"error\";\n",
" if (this.hasError) {\n",
...
...
@@ -171,10 +177,14 @@
"\n",
"<!-- Parsec widget -->\n",
"<script>\n",
"// Only load this script once.\n",
"var kernel = IPython.notebook.kernel;\n",
"var initialized = kernel !== undefined && kernel != null;\n",
"if (initialized && window.parsecWidgetRegistered === undefined) {\n",
"\n",
"// Do not load this script again.\n",
"window.parsecWidgetRegistered = true;\n",
"\n",
"// Register the comm target.\n",
"var ParsecWidget = function (comm) {\n",
" this.comm = comm;\n",
...
...
@@ -222,11 +232,13 @@
" // Update every key press.\n",
" editor.on(\"keyup\", function() {\n",
" var text = editor.getDoc().getValue();\n",
" console.log(\"Sent\",text); \n",
" comm.send({\"text\": text});\n",
" });\n",
"};\n",
"\n",
"ParsecWidget.prototype.handler = function(msg) {\n",
" console.log(\"Handler\", msg); \n",
" var data = msg.content.data;\n",
" this.hasError = data[\"status\"] == \"error\";\n",
" if (this.hasError) {\n",
...
...
@@ -253,7 +265,7 @@
"output_type": "display_data"
}
],
"prompt_number":
2
"prompt_number":
3
},
{
"cell_type": "code",
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment