Skip to content

Commit 9297ce4

Browse files
committed
Improve devdocs.
1 parent f1663ab commit 9297ce4

File tree

1 file changed

+41
-43
lines changed

1 file changed

+41
-43
lines changed

devdocs/JUPYTER_KOTLIN_KERNEL.md

Lines changed: 41 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,30 @@
1-
Install:
2-
--------
3-
pip install kotlin-jupyter-kernel
1+
## Install:
2+
`$ pip install kotlin-jupyter-kernel`
43

5-
Install dev:
6-
------------
7-
`pip install -i https://test.pypi.org/simple/ kotlin-jupyter-kernel`
4+
## Install dev:
5+
`$ pip install -i https://test.pypi.org/simple/ kotlin-jupyter-kernel`
86

9-
Build and install Kernel from sources:
10-
--------------------------------------
7+
## Build and install Kernel from sources:
118
Github: https://github.com/Kotlin/kotlin-jupyter
129

13-
`./gradlew install`
10+
`$ ./gradlew install`
1411

1512
If built successfully it will install the kernel to:
1613
> ~/.ipython/kernels/kotlin
1714
1815
Normally the kernel is installed to conda env.
1916

20-
21-
Library descriptors location
22-
-----------------------------
17+
## Library descriptors location
2318
Lets-Plot library descriptors are files:
2419
- lets-plot.json
2520
- lets-plot-gt.json
2621

2722
After installing kotlin kernel the "bundled" library descriptors are located in
2823

29-
a) After installing via `pip install`:
24+
a) After installing via `$ pip install`:
3025
> /opt/anaconda3/envs/<env name>/lib/python3.7/site-packages/run_kotlin_kernel/libraries/
3126
32-
b) After installing from local sources via `./gradlew install`:
27+
b) After installing from local sources via `$ ./gradlew install`:
3328
> ~/.jupyter_kotlin/cache/libraries/
3429
3530
**Note:** If the `%useLatestDescriptors` **_line magic_** is included in Jupyter notebook,
@@ -39,8 +34,7 @@ b) After installing from local sources via `./gradlew install`:
3934
> ~/.jupyter_kotlin/cache/
4035
4136

42-
About library descriptors (lets-plot.json, lets-plot-gt.json)
43-
------------------------------------------------------------
37+
## About library descriptors (lets-plot.json, lets-plot-gt.json)
4438

4539
- edit descriptor: to conduct local experiments (see more info below).
4640
- remove descriptor: force the kernel to pull current published version of descriptor from 'master' at https://github.com/Kotlin/kotlin-jupyter.
@@ -58,44 +52,48 @@ Descriptors location:
5852
Otherwise, Kotlin Kernel uses 'bundled' descriptors installed to:
5953
> /opt/anaconda3/envs/<env name>/lib/python3.7/site-packages/run_kotlin_kernel/libraries
6054
61-
--------
62-
Conducting experiments with Kotlin Kernel locally.
63-
--------------------------------------------------
55+
## Conducting experiments with Kotlin Kernel locally.
6456

65-
- Publish artifacts to the local dev-repo:
57+
#### 1) Publish artifacts to the local dev-repo:
6658

6759
`$ ./gradlew publishLetsPlotKotlinKernelPublicationToMavenLocalRepository`
6860
`$ ./gradlew publishLetsPlotKotlinGeoToolsPublicationToMavenLocalRepository`
6961

7062
It will publish `lets-plot-kotlin-api-kernel-<version>` artifact to the `<project root>/.maven-publish-dev-repo/` folder.
7163

72-
- edit "lets-plot.json" (see info above about its location):
73-
74-
- add Maven Local repository:
75-
```
76-
"repositories": [
77-
"file://<path to the project root>/.maven-publish-dev-repo"
78-
],
79-
```
80-
81-
- configure the artifact (i.e. "api") version, for example:
82-
```
83-
"properties": {
84-
"api": "3.1.2-alpha2",
85-
"lib": "2.3.0-rc2",
86-
"js": "2.3.0rc2",
87-
"isolatedFrame": ""
88-
},
89-
```
90-
64+
#### 2) Edit "lets-plot.json" (see info above about its location):
9165

9266
**Note:** when editing descriptor in "~/.jupyter_kotlin/cache" always check that you are using the latest descriptor.
9367
The kernel can download a newer descriptor at any moment.
9468

95-
**Note:** to use SNAPSHOTS from Sonatype repository, add the following repository to the descriptor:
96-
`"https://oss.sonatype.org/content/repositories/snapshots"`
9769

98-
**Alternatively**, if you do not want to rely on a "cached" descriptor, you can load any of your library descriptors using the **_line magic_**:
70+
**Alternatively**, if you do not want to rely on a "cached" descriptor, you can load any of your library descriptors using the **_line magic_**:
9971
```
72+
//%use lets-plot
10073
%use @/Users/me/Projects/lets-plot-kotlin/lets-plot-dev.json
101-
```
74+
```
75+
76+
- add _Maven Local_ or _Sonatype SNAPSHOT_ repository or both:
77+
```
78+
"repositories": [
79+
"file://<path to the project root>/.maven-publish-dev-repo",
80+
"https://oss.sonatype.org/content/repositories/snapshots"
81+
],
82+
```
83+
84+
- configure the artifacts version (published Lets-Plot JS):
85+
```
86+
"properties": {
87+
"api": "3.1.2-alpha2",
88+
"lib": "2.3.0-rc2",
89+
"js": "2.3.0rc2",
90+
"isolatedFrame": ""
91+
},
92+
```
93+
- if experimenting with Lets-Plot JS which is not published:
94+
- Set "js" version to "dev";
95+
- Build "dev" JS package (see [lets-plot/js-package/README.md](https://github.com/JetBrains/lets-plot/blob/master/js-package/README.md));
96+
- Activate any "env" containing Python;
97+
- Start local HTTP-server serving the JS dev-version:
98+
- `$ cd lets-plot`
99+
- `$ python -m http.server 8000`

0 commit comments

Comments
 (0)