Athena

pipeline status

An ANSI to HTML converter. Built for the usage of Cucumber output.

Installation

def deps do
  [
    {:athena, "~> 0.1.0"}
  ]
end

Documentation can be generated with ExDoc.

The docs can be found at https://hexdocs.pm/athena.

Examples

Basic usage:

iex> Athena.ansi_to_html("\e[4mfoo\e[0m")
"<span style=&#39;text-decoration: underline;&#39;>foo</span>"

To see the list of support ansi_codes:

iex> Athena.ansi_codes()
%{
  "0m" => "</span>",
  "1m" => "<span style=&#39;font-weight: bold;&#39;>",
  "4m" => "<span style=&#39;text-decoration: underline;&#39;>",
  "30m" => "<span style=&#39;color: black;&#39;>",
  "31m" => "<span style=&#39;color: red;&#39;>",
  ...
}

Contributing

Issues and PRs are welcome. If you are to make a PR, please use the mix format command before committing.