Use Kino as example instead of Jason (#538)

This commit is contained in:
José Valim 2021-09-03 12:34:37 +02:00 committed by GitHub
parent 6bf0a6ba7c
commit bbd7cc79f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -73,14 +73,21 @@ instance, otherwise the command below will fail.
```elixir ```elixir
Mix.install([ 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
%{elixir: "is awesome"} data = [
|> Jason.encode!() %{id: 1, name: "Elixir", website: "https://elixir-lang.org"},
|> IO.puts() %{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, It is a good idea to specify versions of the installed packages,