Packages

Textmatrix in Elixir. Make working with 2D text a breeze.

Current section

Files

Jump to
textmatrix lib textmatrix.ex
Raw

lib/textmatrix.ex

defmodule Textmatrix do
@moduledoc """
Textmatrix is a _thin_ wrapper around Charlists
to make working with two dimensional text a breeze.
Once you're done, turn it into a multiline string.
## Example
iex> Textmatrix.new()
...> |> Textmatrix.write(2, 2, "Hello, world!")
...> |> Textmatrix.to_string()
\n\n Hello, world!
"""
alias Textmatrix.Buffer
defdelegate new(), to: Buffer
defdelegate write(buffer, x, y, string), to: Buffer
defdelegate to_string(buffer), to: Buffer
end