Skip to content

Commit

Permalink
update notebook support
Browse files Browse the repository at this point in the history
  • Loading branch information
breandan committed Mar 9, 2021
1 parent 82f50f7 commit 4a4d76b
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 474 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ repositories {
}

dependencies {
implementation("com.github.breandan:kotlingrad:0.4.1")
implementation("com.github.breandan:kotlingrad:0.4.2")
}
```

Expand All @@ -99,7 +99,7 @@ dependencies {
<dependency>
<groupId>com.github.breandan</groupId>
<artifactId>kotlingrad</artifactId>
<version>0.4.1</version>
<version>0.4.2</version>
</dependency>
</project>
```
Expand All @@ -109,7 +109,8 @@ dependencies {
To access Kotlin∇'s notebook support, use the following line magic:

```
%use @https://raw.githubusercontent.com/breandan/kotlingrad/master/core/kotlingrad.json
@file:Repository("https://jitpack.io")
@file:DependsOn("com.github.breandan:kotlingrad:0.4.2")
```

For more information, explore the [tutorial](samples/notebooks/hello_kotlingrad.ipynb).
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ allprojects {
}

group = "com.github.breandan"
version = "0.4.1"
version = "0.4.2"

apply(plugin = "org.jetbrains.kotlin.jvm")

Expand Down
2 changes: 1 addition & 1 deletion core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
`maven-publish`
id("shipshape")
idea
kotlin("jupyter.api") version "0.8.3.255"
kotlin("jupyter.api") version "0.8.3.268"
}

// TODO: Maybe move this into the plugin somehow?
Expand Down
45 changes: 0 additions & 45 deletions core/kotlingrad.json

This file was deleted.

37 changes: 18 additions & 19 deletions core/src/main/kotlin/edu/umontreal/kotlingrad/api/KotlinJupyter.kt
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
package edu.umontreal.kotlingrad.api

//import org.jetbrains.kotlinx.jupyter.api.annotations.JupyterLibrary
//import org.jetbrains.kotlinx.jupyter.api.*
//import org.jetbrains.kotlinx.jupyter.api.libraries.*
//
//@JupyterLibrary
//class Integration: JupyterIntegration() {
// override fun Builder.onLoaded() {
// listOf(
// "edu.umontreal.kotlingrad.api.*",
//// "edu.mcgill.kaliningraph.*"
// ).forEach { import(it) }
//
//// render<Fun<*>> { HTML(it.render().toString()) }
//
// // https://github.com/Kotlin/kotlin-jupyter/blob/master/docs/libraries.md#integration-using-kotlin-api
// // https://github.com/nikitinas/dataframe/blob/master/src/main/kotlin/org/jetbrains/dataframe/jupyter/Integration.kt
// // https://github.com/mipt-npm/visionforge/blob/dev/demo/jupyter-playground/src/main/kotlin/hep/dataforge/playground/VisionForgePlayGroundForJupyter.kt
// }
//}
import org.jetbrains.kotlinx.jupyter.api.annotations.JupyterLibrary
import org.jetbrains.kotlinx.jupyter.api.*
import org.jetbrains.kotlinx.jupyter.api.libraries.*

@JupyterLibrary
class Integration: JupyterIntegration() {
override fun Builder.onLoaded() {
listOf(
"edu.umontreal.kotlingrad.api.*",
).forEach { import(it) }

render<Fun<*>> { HTML(it.render().toString()) }

// https://github.com/Kotlin/kotlin-jupyter/blob/master/docs/libraries.md#integration-using-kotlin-api
// https://github.com/nikitinas/dataframe/blob/master/src/main/kotlin/org/jetbrains/dataframe/jupyter/Integration.kt
// https://github.com/mipt-npm/visionforge/blob/dev/demo/jupyter-playground/src/main/kotlin/hep/dataforge/playground/VisionForgePlayGroundForJupyter.kt
}
}
2 changes: 1 addition & 1 deletion kaliningraph

0 comments on commit 4a4d76b

Please sign in to comment.