mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-09-12 16:04:39 +08:00
Small fixes to the explore docs (#953)
* Fix Intro to Kino link in chat_app.livemd * Install Kino before usage in distributed portals exploration
This commit is contained in:
parent
b1b573b5f4
commit
6bae9f3d93
2 changed files with 7 additions and 21 deletions
|
@ -699,34 +699,20 @@ and execute it:
|
||||||
<!-- livebook:{"force_markdown":true} -->
|
<!-- livebook:{"force_markdown":true} -->
|
||||||
|
|
||||||
```elixir
|
```elixir
|
||||||
IO.puts node()
|
IO.inspect node()
|
||||||
IO.puts Node.get_cookie()
|
IO.inspect Node.get_cookie()
|
||||||
```
|
```
|
||||||
|
|
||||||
Now paste the result of the other node name and its cookie in the inputs below:
|
Now paste the result of the other node name and its cookie in the variables below:
|
||||||
|
|
||||||
```elixir
|
```elixir
|
||||||
node_input = Kino.Input.text("Other node")
|
other_node = :"name-of-the@other-node"
|
||||||
|
other_cookie = :"value-of-the-other-cookie"
|
||||||
```
|
```
|
||||||
|
|
||||||
```elixir
|
With both variables defined, let's connect to the other node with the given cookie:
|
||||||
cookie_input = Kino.Input.text("Other cookie")
|
|
||||||
```
|
|
||||||
|
|
||||||
And now execute the code cell below, which will read the inputs, configure the
|
|
||||||
cookie, and connect to the other notebook:
|
|
||||||
|
|
||||||
```elixir
|
```elixir
|
||||||
other_node =
|
|
||||||
node_input
|
|
||||||
|> Kino.Input.read()
|
|
||||||
|> String.to_atom()
|
|
||||||
|
|
||||||
other_cookie =
|
|
||||||
cookie_input
|
|
||||||
|> Kino.Input.read()
|
|
||||||
|> String.to_atom()
|
|
||||||
|
|
||||||
Node.set_cookie(other_node, other_cookie)
|
Node.set_cookie(other_node, other_cookie)
|
||||||
Node.connect(other_node)
|
Node.connect(other_node)
|
||||||
```
|
```
|
||||||
|
|
|
@ -14,7 +14,7 @@ Mix.install([
|
||||||
|
|
||||||
## Kino.Control
|
## Kino.Control
|
||||||
|
|
||||||
In our [introduction to Kino](/explore/notebooks/intro_to_kino),
|
In our [introduction to Kino](/explore/notebooks/intro-to-kino),
|
||||||
we learned about inputs and several different outputs, such as
|
we learned about inputs and several different outputs, such as
|
||||||
tables, frames, and more. In particular, we learned how to use
|
tables, frames, and more. In particular, we learned how to use
|
||||||
inputs to capture values directly into our notebooks:
|
inputs to capture values directly into our notebooks:
|
||||||
|
|
Loading…
Add table
Reference in a new issue