mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-01-01 12:41:43 +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} -->
|
||||
|
||||
```elixir
|
||||
IO.puts node()
|
||||
IO.puts Node.get_cookie()
|
||||
IO.inspect node()
|
||||
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
|
||||
node_input = Kino.Input.text("Other node")
|
||||
other_node = :"name-of-the@other-node"
|
||||
other_cookie = :"value-of-the-other-cookie"
|
||||
```
|
||||
|
||||
```elixir
|
||||
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:
|
||||
With both variables defined, let's connect to the other node with the given cookie:
|
||||
|
||||
```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.connect(other_node)
|
||||
```
|
||||
|
|
|
@ -14,7 +14,7 @@ Mix.install([
|
|||
|
||||
## 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
|
||||
tables, frames, and more. In particular, we learned how to use
|
||||
inputs to capture values directly into our notebooks:
|
||||
|
|
Loading…
Reference in a new issue