livebook/README.md

80 lines
3.8 KiB
Markdown
Raw Normal View History

2021-04-04 18:42:46 +08:00
<h1><img src="https://github.com/elixir-nx/livebook/raw/main/priv/static/logo-with-text.png" alt="Livebook" width="400"></h1>
2021-01-08 03:55:45 +08:00
2021-04-13 18:34:03 +08:00
Livebook is a web application for writing interactive and collaborative code notebooks. It features:
2021-01-08 03:55:45 +08:00
2021-04-13 18:34:03 +08:00
* A deployable web app built with [Phoenix LiveView](https://github.com/phoenixframework/phoenix_live_view)
2021-04-05 22:46:17 +08:00
where users can create, fork, and run multiple notebooks.
* Each notebook is made of multiple sections: each section is made of Markdown and Elixir
2021-04-13 19:28:54 +08:00
cells. Code in Elixir cells can be evaluated on demand. Mathematical formulas are also
2021-04-08 21:33:57 +08:00
supported via [KaTeX](https://katex.org/).
2021-01-08 03:55:45 +08:00
2021-04-08 21:33:57 +08:00
* Persistence: notebooks can be persisted to disk through the `.livemd` format, which is a
2021-04-05 22:46:17 +08:00
subset of Markdown. This means your notebooks can be saved for later, easily shared, and
2021-04-08 21:33:57 +08:00
they also play well with version control.
2021-01-08 03:55:45 +08:00
2021-04-05 22:46:17 +08:00
* Sequential evaluation: code cells run in a specific order, guaranteeing future users of
2021-04-09 04:27:08 +08:00
the same Livebook see the same output. If you re-execute a previous cell, following cells
2021-04-13 19:28:54 +08:00
are marked as stale to make it clear they depend on outdated notebook state.
2021-01-08 03:55:45 +08:00
2021-04-05 22:46:17 +08:00
* Custom runtimes: when executing Elixir code, you can either start a fresh Elixir process,
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 provide
live documentation for existing projects.
2021-01-08 03:55:45 +08:00
2021-04-09 04:40:21 +08:00
* Explicit dependencies: if your notebook has dependencies, they are explicitly listed and
installed with the help of the `Mix.install/2` command in Elixir v1.12+.
2021-04-05 22:46:17 +08:00
* Collaborative features allow multiple users to work on the same notebook at once.
Collaboration works either in single-node or multi-node deployments - without a
need for additional tooling.
2021-04-13 23:38:43 +08:00
There is a [screencast by José Valim showing some of Livebook features](https://www.youtube.com/watch?v=RKvqc-UEe34).
Otherwise, here is a peek at the "Welcome to Livebook" introductory notebook:
2021-04-05 22:46:17 +08:00
![Screenshot](https://user-images.githubusercontent.com/9582/113567534-166f4980-960f-11eb-98df-c0b8b81f8a27.png)
2021-04-14 03:37:04 +08:00
The current version provides only the initial step of our Livebook vision. Our plan
is to continue focusing on visual, collaborative, and interactive features in the
upcoming releases.
2021-04-05 22:46:17 +08:00
## Usage
For now, the best way to run Livebook is by cloning it and running it locally:
$ git clone https://github.com/elixir-nx/livebook.git
$ cd livebook
$ mix deps.get --only prod
$ MIX_ENV=prod mix phx.server
You will need [Elixir v1.11](https://elixir-lang.org/install.html) or later.
2021-04-08 21:33:57 +08:00
We will work on other distribution modes (escripts, Docker images, etc) once
we start distributing official releases.
2021-04-05 22:46:17 +08:00
2021-04-14 03:37:04 +08:00
## Security considerations
Livebook is built to document and execute code. Anyone with access to a
Livebook instance will be able to access any file and execute any code
in the machine Livebook is running.
For this reason, `Livebook` only binds to the 127.0.0.1, allowing access
to happen only within the current machine. When running `Livebook` in the
production environment - the recommended environment - we also generate a
token on initialization and we only allow access to the Livebook if said
token is supplied as part of the URL.
2021-04-05 22:46:17 +08:00
## License
Copyright (C) 2021 Dashbit
2021-04-14 03:33:30 +08:00
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.