### Basic ExRatatui 'Hello World' TUI Source: https://hexdocs.pm/ex_ratatui A simple 'Hello World' example demonstrating how to initialize ExRatatui, draw a styled paragraph, and wait for user input. ```elixir alias ExRatatui.Layout.Rect alias ExRatatui.Style alias ExRatatui.Widgets.{Block, Paragraph} ExRatatui.run(fn terminal -> {w, h} = ExRatatui.terminal_size() paragraph = %Paragraph{ text: "Hello from ExRatatui!\n\nPress any key to exit.", style: %Style{fg: :green, modifiers: [:bold]}, alignment: :center, block: %Block{ title: " Hello World ", borders: [:all], border_type: :rounded, border_style: %Style{fg: :cyan} } } ExRatatui.draw(terminal, [{paragraph, %Rect{x: 0, y: 0, width: w, height: h}}]) # Wait for a keypress, then exit ExRatatui.poll_event(60_000) end) ``` -------------------------------- ### Counter App with ExRatatui.App Source: https://hexdocs.pm/ex_ratatui An example of a counter application built using the ExRatatui.App behavior. ```elixir mix run examples/counter_app.exs ``` -------------------------------- ### Minimal Paragraph Display Source: https://hexdocs.pm/ex_ratatui A basic example demonstrating how to display a minimal paragraph using ExRatatui. ```elixir mix run examples/hello_world.exs ``` -------------------------------- ### Fetch and Compile Dependencies Source: https://hexdocs.pm/ex_ratatui After adding `ex_ratatui` to your dependencies, fetch and compile them using Mix. ```bash mix deps.get && mix compile ``` -------------------------------- ### Build from Source Flag Source: https://hexdocs.pm/ex_ratatui To compile ExRatatui from source instead of using precompiled NIF binaries, set the `EX_RATATUI_BUILD` environment variable to `true`. ```bash export EX_RATATUI_BUILD=true ``` -------------------------------- ### ExRatatui Architecture Overview Source: https://hexdocs.pm/ex_ratatui Illustrates the data flow for rendering Elixir structs to the terminal and handling terminal events via Rustler NIFs. ```text Elixir structs -> encode to maps -> Rust NIF -> decode to ratatui types -> render to terminal Terminal events -> Rust NIF (DirtyIo) -> encode to tuples -> Elixir Event structs ``` -------------------------------- ### Add ExRatatui to Mix Dependencies Source: https://hexdocs.pm/ex_ratatui Add `ex_ratatui` to your project's dependencies in `mix.exs` to include it in your project. ```elixir def deps do [ {:ex_ratatui, "~> 0.10"} ] end ``` -------------------------------- ### Distributed Transport Process Architecture Source: https://hexdocs.pm/ex_ratatui Explains the architecture for the distributed transport, highlighting the Listener and Client GenServers responsible for inter-node communication and rendering. ```text Distributed transport: App node Client node ├── Distributed.Listener └── Distributed.Client (GenServer) │ └── DynamicSupervisor ├── owns terminal reference (NIF) │ └── per client: ├── polls events locally │ Server (GenServer) └── sends events → Server │ └── sends widgets → Client receives widgets ← Server └── No NIF needed here ``` -------------------------------- ### Local Transport Process Architecture Source: https://hexdocs.pm/ex_ratatui Details the GenServer-based architecture for the local transport, including the server's responsibilities for terminal management and event polling. ```text Local transport: Supervisor └── Server (GenServer) ├── owns terminal reference (NIF) ├── polls events on DirtyIo scheduler └── calls your mount/render/handle_event ``` -------------------------------- ### SSH Transport Process Architecture Source: https://hexdocs.pm/ex_ratatui Outlines the architecture for the SSH transport, showing how SSH channels and a dedicated Server GenServer manage remote terminal sessions. ```text SSH transport: Supervisor └── SSH.Daemon (GenServer, wraps :ssh.daemon) └── per client: SSH channel (:ssh_server_channel) ├── owns Session (in-memory terminal) ├── parses ANSI input → events └── Server (GenServer) └── calls your mount/render/handle_event ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.