Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/acalejos/livewriter
Tools for programmatically writing Elixir Livebook notebooks using Elixir.
https://github.com/acalejos/livewriter
Last synced: 7 days ago
JSON representation
Tools for programmatically writing Elixir Livebook notebooks using Elixir.
- Host: GitHub
- URL: https://github.com/acalejos/livewriter
- Owner: acalejos
- License: mit
- Created: 2024-07-19T02:47:32.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-07-19T02:48:41.000Z (4 months ago)
- Last Synced: 2024-07-19T11:22:20.662Z (4 months ago)
- Language: Elixir
- Size: 10.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-livebook - LiveWriter - Tools for programmatically writing Elixir Livebook notebooks using Elixir. ![Community](https://img.shields.io/badge/Community-green) (Tools)
- awesome-livebook - LiveWriter - Tools for programmatically writing Elixir Livebook notebooks using Elixir. ![Community](https://img.shields.io/badge/Community-green) (Tools)
README
# Livewriter
Tools for programmatically writing Elixir Livebook notebooks using Elixir.
For now, `Livewriter` exposes a small and simple Domain Specific Language (DSL) for Livebooks,
as well as a `from_docs` macro to generate Livebooks from the given modules' documentation.## Installation
If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `livewriter` to your list of dependencies in `mix.exs`:```elixir
def deps do
[
{:livewriter, github: "acalejos/livewriter"}
]
end
```## Configuration
You will need to configure your application to use the `:livebook` dependency included in
`Livewriter`. Here is an example of a minimal configuration you can use:### `config.exs`
```elixir
import Configconfig :livebook,
aws_credentials: false,
epmdless: true,
iframe_port: 8082,
default_runtime: {Livebook.Runtime.Embedded, []}config :livebook, Livebook.Apps.Manager, retry_backoff_base_ms: 500
```### `runtime.exs`
```elixir
Livebook.config_runtime()
```## Examples
```elixir
import Livewriterlivebook do
setup do
Mix.install([
{:ecto, "~> 3.11"}
])
end
section id: "section1" do
elixir do
a = 1
b = 2
c = a + b
endelixir do
d = c * b * a
end
endsection name: "Forked", fork: "section1" do
elixir do
IO.puts("First Line")
endmarkdown do
"""
This is some markdown:* You can see clearly now
"""
end
end
end
|> print!()
``````elixir
import Livewriter
result = Livewriter.from_docs(Test) |> print!(include_outputs: true)
```