Improve docs

This commit is contained in:
José Valim 2022-09-09 16:48:06 +02:00
parent 7175ad314e
commit 0fd6eed255
3 changed files with 38 additions and 9 deletions

View file

@ -4,9 +4,9 @@
</a>
</h1>
[![Website](https://img.shields.io/badge/-Website-%23ff87a7)](https://livebook.dev/) [![Hex.pm](https://img.shields.io/hexpm/v/livebook?color=b5a3be)](https://hex.pm/packages/livebook)
[![Website](https://img.shields.io/badge/-Website-%23ff87a7)](https://livebook.dev/) [![Version](https://img.shields.io/hexpm/v/livebook?color=b5a3be)](https://hex.pm/packages/livebook)
Livebook is a web application for writing interactive and collaborative code notebooks for Elixir, built with [Phoenix LiveView](https://github.com/phoenixframework/phoenix_live_view). It features:
Livebook is a web application for writing interactive and collaborative code notebooks. It features:
* Code notebooks with Markdown support and Code cells where Elixir code is evaluated on demand.
@ -26,11 +26,9 @@ Livebook is a web application for writing interactive and collaborative code not
* Custom runtimes: when executing Elixir code, you can either start a fresh Elixir instance, connect to an existing node, or run it inside an existing Elixir project, with access to all of its modules and dependencies. This means Livebook can be a great tool to introspect and document existing projects too.
We are actively working on Livebook and you can consult the issues tracker to see some of the features we are exploring!
## Getting started
Livebook comes with a series of introductory notebooks to get you up and running. Just head down to the "Installation" section below to install it. Here is a peek at the "Welcome to Livebook" introductory notebook:
Head out to [the Install section](https://livebook.dev/#install) of Livebook's website to get started. Once Livebook is up and running on your machine, **visit the "Explore" section** with introductory guides and documentation on several Livebook features. Here is a sneak peak of the "Welcome to Livebook" guide:
![Screenshot](https://github.com/livebook-dev/livebook/raw/main/.github/imgs/welcome.png)
@ -47,7 +45,7 @@ pick the one that best fits your use case.
### Desktop app
* [Download the installer for Windows and Mac from our homepage](https://livebook.dev/)
* [Download the installer for Windows and Mac from our homepage](https://livebook.dev/#install)
### Docker
@ -213,6 +211,9 @@ variables used by Elixir releases are also available](
https://hexdocs.pm/mix/Mix.Tasks.Release.html#module-environment-variables).
The notables ones are `RELEASE_NODE` and `RELEASE_DISTRIBUTION`.
If running Livebook via the command line, run `livebook server --help` to see
all CLI-specific options.
## Development
Livebook is primarily a Phoenix web application and can be setup as such:
@ -225,6 +226,9 @@ mix dev.setup
# Run the Livebook server
mix phx.server
# Run tests
mix test
# To test escript
MIX_ENV=prod mix escript.build
./livebook server

View file

@ -52,7 +52,9 @@ By default, a new Elixir node is started (similarly to starting `iex`). You
can click reconnect whenever you want to discard the current node and start
a new one.
You can also manually *attach* to an existing distributed node.
You can also manually *attach* to an existing distributed node by picking the
"Attached Node" runtime. To do so, you will need the Erlang Name of the external
node and its Erlang Cookie.
## Mix projects

View file

@ -207,11 +207,34 @@ The above example renders new Markdown output every 100ms.
You can use the same approach to render regular output
or images too!
## `dbg`
Kino hijacks Elixir's [`dbg/2`](https://hexdocs.pm/elixir/Kernel.html#dbg/2)
to provide Kino-based debugging:
```elixir
dbg(Atom.to_string(:hello))
```
When debugging a pipeline, Kino will render each step of the pipeline, allowing
to inspect, toggle, and swap each operation along the way:
```elixir
"Elixir is cool!"
|> String.trim_trailing("!")
|> String.split()
|> List.first()
|> dbg()
```
## Next steps with custom Kinos
With this, we finished our introduction to Kino. Most the guides
ahead of us will use Kino in one way or the other. You can jump
into [the VegaLite guide](/explore/notebooks/intro-to-vega-lite)
for plotting charts or [the MapLibre guide](/explore/notebooks/intro-to-vega-lite)
for rendering maps.
for plotting charts or [the MapLibre guide](/explore/notebooks/intro-to-maplibre)
for rendering maps to learn how other packages extend Livebook
through Kino.
We also have a collection of deep dive guides into Kino in the
[Explore](/explore) page if you want to learn more, including how