mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-02-20 21:04:17 +08:00
Use Kino as example instead of Jason (#538)
This commit is contained in:
parent
6bf0a6ba7c
commit
bbd7cc79f5
1 changed files with 11 additions and 4 deletions
|
@ -73,14 +73,21 @@ instance, otherwise the command below will fail.
|
|||
|
||||
```elixir
|
||||
Mix.install([
|
||||
{:jason, "~> 1.2"}
|
||||
{:kino, "~> 0.3.0"}
|
||||
])
|
||||
```
|
||||
|
||||
[Kino](https://github.com/elixir-nx/kino) is a library that
|
||||
allows you to control parts of Livebook directly from the Elixir
|
||||
code. Let's use it to print a data table:
|
||||
|
||||
```elixir
|
||||
%{elixir: "is awesome"}
|
||||
|> Jason.encode!()
|
||||
|> IO.puts()
|
||||
data = [
|
||||
%{id: 1, name: "Elixir", website: "https://elixir-lang.org"},
|
||||
%{id: 2, name: "Erlang", website: "https://www.erlang.org"}
|
||||
]
|
||||
|
||||
Kino.DataTable.new(data)
|
||||
```
|
||||
|
||||
It is a good idea to specify versions of the installed packages,
|
||||
|
|
Loading…
Reference in a new issue