Commit e55d91b2 authored by rloic's avatar rloic

Add journal

parent 7eed2235
# Example of Hydrogen Usage
```kotlin
println("Hello World!") // I use the kotlin kernel
```
Kotlin allow to `html` outputs:
```kotlin
HTML("<h1>This is the Header !</h1>")
```
```python
print('Hello World!') # I use the python kernel
```
You can also use pyplot or graphical ouputs :
```python
import matplotlib.pyplot as plt
%matplotlib inline
plt.plot([2, 3, 4, 5])
plt.show()
```
```bash
hostname
```
# Hydrogen : An alternative to Jupyter
## Installation
[Hydrogen](https://nteract.io/) is an extension for [Atom](https://atom.io/) editor. It works with [Jupyter](https://jupyter.org/) and multiple languages.
To install atom use the link above to download atom. I recommand to use conda to install python and jupyter. Install the last nodejs version from [here](https://nodejs.org/en/).
Once you have installed Jupyter, Node and Atom you can install hydrogen :
```bash
apm install hydrogen
```
## Usage
For each language you have to install the grammar in Atom and the kernel in Jupyter. For the most common languages it's generally easy to find both.
### Example
To install allow Hydrogen to handle the Kotlin language, I search `language kotlin` in the package manager of atom (menu `Edit > Preferences > Install`).
I found this one [atom-kotlin-language](https://github.com/alexmt/atom-kotlin-language). You must verify that the package contains the language grammar. If you know the package name you can install it with apm (Atom package manager) :
```bash
apm install language-kotlin
```
After that I install the kotlin kernel available on [github](https://github.com/Kotlin/kotlin-jupyter):
```bash
conda install kotlin-jupyter-kernel -c jetbrains
```
When the both tasks are done you can know execute the code in block comments by pressing `Ctrl + Enter` in the block section :
```python
print("Hello World")
```
```markdown
```kotlin
println("Hello World")
​```
```
![Kotlin run example](run_kt.png)
You can use multiple languages in the same document, as the kernel is choose by the language name, i.e. the code block :
```markdown
This block will call python interpreter
```python
print('ok')
```
This block will call kotlin interpreter
```kotlin
println("Ok")
```
```
You can find an usage example at [usage](example.md) and view the [result in the IDE](example.png)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment