Skip to content
This repository was archived by the owner on Jan 11, 2022. It is now read-only.

Commit a27b92b

Browse files
committed
Initial commit
0 parents  commit a27b92b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+5592
-0
lines changed

.gitignore

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/_build
2+
/cover
3+
/deps
4+
/.idea
5+
erl_crash.dump
6+
*.ez
7+
*.iml
8+
/ielixir
9+
test_db.sqlite3
10+
.DS_store
11+
resources/ielixir/kernel.json
12+
13+
.elixir_ls
14+
*.sqlite3
15+
envs
16+
17+
**/.ipynb_checkpoints/

.tool-versions

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
erlang 24.0
2+
elixir 1.12.0-otp-24
3+
python 3.9.7

LICENSE

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright 2021 iLHub
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
IElixir
2+
=======
3+
4+
Jupyter's kernel for Elixir

config/config.exs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import Config
2+
3+
if Mix.env() == :prod do
4+
config :logger,
5+
level: :info
6+
else
7+
config :logger,
8+
level: :debug
9+
end

jupyterlab-ielixir/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
lib/

jupyterlab-ielixir/README.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
## Installation
2+
3+
```
4+
jupyter labextension install jupyterlab-ielixir
5+
```
6+
7+
## Development
8+
9+
For a development install (requires npm version 4 or later), do the following in the repository directory:
10+
11+
```
12+
npm install
13+
npm run build
14+
jupyter labextension link .
15+
```
16+
17+
To rebuild the package and the JupyterLab app:
18+
19+
```
20+
npm run build
21+
jupyter lab build
22+
```

jupyterlab-ielixir/package.json

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"name": "jupyterlab-ielixir",
3+
"version": "0.0.1",
4+
"description": "adds ihaskell syntax highlighting to jupyterlab",
5+
"keywords": [
6+
"jupyter",
7+
"jupyterlab",
8+
"ihaskell",
9+
"jupyterlab-extension"
10+
],
11+
"homepage": "https://github.com/ilhub/ielixir/",
12+
"bugs": {
13+
"url": "https://github.com/ilhub/ielixir/issues"
14+
},
15+
"license": "BSD-3-Clause",
16+
"author": "Virviil",
17+
"files": [
18+
"lib/**/*.{d.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf}",
19+
"style/**/*.{css,eot,gif,html,jpg,json,png,svg,woff2,ttf}"
20+
],
21+
"main": "lib/index.js",
22+
"types": "lib/index.d.ts",
23+
"repository": {
24+
"type": "git",
25+
"url": "[email protected]:ilhub/ielixir.git"
26+
},
27+
"scripts": {
28+
"build": "tsc",
29+
"clean": "rimraf lib",
30+
"watch": "tsc -w"
31+
},
32+
"dependencies": {
33+
"@jupyterlab/application": ">=2.0.0",
34+
"@jupyterlab/apputils": ">=2.0.0",
35+
"@jupyterlab/docregistry": ">=2.0.0",
36+
"@jupyterlab/notebook": ">=2.0.0",
37+
"@jupyterlab/services": ">=3.0.1",
38+
"@lumino/disposable": "^1.1.2",
39+
"codemirror": "^5.61.0",
40+
"codemirror-mode-elixir": "^1.1.2"
41+
},
42+
"devDependencies": {
43+
"rimraf": "^3.0.0",
44+
"typescript": "~3.7.3"
45+
},
46+
"jupyterlab": {
47+
"extension": true
48+
}
49+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import * as CodeMirror from 'codemirror';
2+
import "codemirror-mode-elixir";
3+
4+
CodeMirror.defineMode("ielixir", (config) => {
5+
let hmode = CodeMirror.getMode(config, "elixir");
6+
return CodeMirror.multiplexingMode(
7+
hmode,
8+
{
9+
open: /:(?=!)/, // Matches : followed by !, but doesn't consume !
10+
close: /^(?!!)/, // Matches start of line not followed by !, doesn't consume character
11+
mode: CodeMirror.getMode(config, "text/plain"),
12+
delimStyle: "delimit",
13+
},
14+
{
15+
open: /\[r\||\[rprint\||\[rgraph\|/,
16+
close: /\|\]/,
17+
mode: CodeMirror.getMode(config, "text/x-rsrc"),
18+
delimStyle: "delimit",
19+
}
20+
);
21+
});
22+
23+
CodeMirror.defineMIME("text/x-ielixir", "ielixir");
24+
25+
CodeMirror.modeInfo.push({
26+
ext: ["ex"],
27+
mime: "text/x-ielixir",
28+
mode: "ielixir",
29+
name: "ielixir",
30+
});

jupyterlab-ielixir/src/index.ts

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
import {
3+
JupyterFrontEnd, JupyterFrontEndPlugin
4+
} from '@jupyterlab/application';
5+
6+
import './codemirror-ielixir';
7+
8+
import '../style/index.css';
9+
10+
/**
11+
* Initialization data for the extension1 extension.
12+
*/
13+
const extension: JupyterFrontEndPlugin<void> = {
14+
id: 'ielixir',
15+
autoStart: true,
16+
requires: [],
17+
activate: (app: JupyterFrontEnd) =>
18+
{
19+
app.serviceManager.ready
20+
.then(() => {defineIElixir()});
21+
}
22+
};
23+
24+
function defineIElixir() {
25+
console.log('ielixir codemirror activated');
26+
}
27+
28+
29+
export default extension;

jupyterlab-ielixir/style/index.css

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* To be created custom styles */

jupyterlab-ielixir/tsconfig.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"compilerOptions": {
3+
"declaration": true,
4+
"noImplicitAny": false,
5+
"noEmitOnError": true,
6+
"noUnusedLocals": true,
7+
"allowSyntheticDefaultImports": true,
8+
"module": "commonjs",
9+
"moduleResolution": "node",
10+
"target": "es2015",
11+
"outDir": "./lib",
12+
"lib": ["dom", "es2015"],
13+
"types": []
14+
},
15+
"include": ["src/*"]
16+
}

0 commit comments

Comments
 (0)