Skip to content

Commit 2713355

Browse files
committed
fix: update livebook input to kino
1 parent 204827a commit 2713355

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

docs.livemd

+12-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ Imagine how much is gained when the search functionality of your application res
1111
## Getting Started
1212

1313
```elixir
14-
Mix.install([{:elasticlunr, "~> 0.6"}])
14+
Mix.install([
15+
{:kino, "~> 0.4"},
16+
{:elasticlunr, "~> 0.6"}
17+
])
1518
```
1619

1720
## What's an Index?
@@ -94,10 +97,12 @@ The search results is a list of maps and each map contains specific keys, `match
9497
* **ref:** this is the document id
9598
* **positions:** this is a map that shows the positions of the matching words in the document
9699

97-
<!-- livebook:{"livebook_object":"cell_input","name":"Search","type":"text","value":"elixir"} -->
100+
```elixir
101+
search_query = Kino.Input.text("Search", default: "elixir")
102+
```
98103

99104
```elixir
100-
search_query = IO.gets("Search")
105+
search_query = Kino.Input.read(search_query)
101106
results = Index.search(index, search_query)
102107
```
103108

@@ -177,10 +182,12 @@ documents = [
177182
users_index = Index.add_documents(users_index, documents)
178183
```
179184

180-
<!-- livebook:{"livebook_object":"cell_input","name":"Search users","type":"text","value":"jason murry"} -->
185+
```elixir
186+
search_query = Kino.Input.text("Search users", default: "jason murry")
187+
```
181188

182189
```elixir
183-
search_query = IO.gets("Search users")
190+
search_query = Kino.Input.read(search_query)
184191
Index.search(users_index, search_query)
185192
```
186193

0 commit comments

Comments
 (0)