mirror of
https://github.com/livebook-dev/livebook.git
synced 2024-12-26 17:33:44 +08:00
Update Kino introductory notebook with Markdown output (#406)
This commit is contained in:
parent
ea413dd5b9
commit
a49111afe0
1 changed files with 28 additions and 1 deletions
|
@ -10,7 +10,7 @@ and interact with it.
|
||||||
|
|
||||||
```elixir
|
```elixir
|
||||||
Mix.install([
|
Mix.install([
|
||||||
{:kino, "~> 0.2.0"},
|
{:kino, "~> 0.2.1"},
|
||||||
{:vega_lite, "~> 0.1.0"}
|
{:vega_lite, "~> 0.1.0"}
|
||||||
])
|
])
|
||||||
```
|
```
|
||||||
|
@ -149,6 +149,33 @@ Kino.DataTable.new(
|
||||||
We can sort by the number of reductions to identify the
|
We can sort by the number of reductions to identify the
|
||||||
most busy processes!
|
most busy processes!
|
||||||
|
|
||||||
|
## Kino.Markdown
|
||||||
|
|
||||||
|
Sometimes you may want to render arbitrary content as rich-text,
|
||||||
|
that's when `Kino.Markdown.new/1` comes into play:
|
||||||
|
|
||||||
|
```elixir
|
||||||
|
"""
|
||||||
|
# Example
|
||||||
|
|
||||||
|
A regular Markdown file.
|
||||||
|
|
||||||
|
## Code
|
||||||
|
|
||||||
|
```elixir
|
||||||
|
"Elixir" |> String.graphemes() |> Enum.frequencies()
|
||||||
|
```
|
||||||
|
|
||||||
|
## Table
|
||||||
|
|
||||||
|
| ID | Name | Website |
|
||||||
|
| -- | ------ | ----------------------- |
|
||||||
|
| 1 | Elixir | https://elixir-lang.org |
|
||||||
|
| 2 | Erlang | https://www.erlang.org |
|
||||||
|
"""
|
||||||
|
|> Kino.Markdown.new()
|
||||||
|
```
|
||||||
|
|
||||||
## Kino.render/1
|
## Kino.render/1
|
||||||
|
|
||||||
As we saw, Livebook automatically recognises widgets returned
|
As we saw, Livebook automatically recognises widgets returned
|
||||||
|
|
Loading…
Reference in a new issue