AnsiToHTML v0.3.0 AnsiToHTML.Theme View Source

AnsiToHTML.Theme structs define how the ANSI should be converted to html tags. You can pass a custom theme to both AnsiToHTML.generate_html/2 and AnsiToHTML.generate_phoenix_html/2 as the second argument.

Tags are matches against their ANSI code and converted to Phoenix.HTML.Tag.t. The expected pattern for a tag is a tuple of an atom representing the html tag, and a keyword list with it's html attributes.

Examples

iex> %AnsiToHTML.Theme{name: "My Theme", container: {:pre, [class: "container"]}, "": {:span, [class: "has-underline"]}}
%AnsiToHTML.Theme{"": {:strong, []},
"": {:span, [style: "color: black;"]},
"": {:span, [style: "color: red;"]},
"": {:span, [style: "color: green;"]},
"": {:span, [style: "color: yellow;"]},
"": {:span, [style: "color: blue;"]},
"": {:span, [style: "color: magenta;"]},
"": {:span, [style: "color: cyan;"]},
"": {:span, [style: "color: white;"]}, "": {:i, []},
"": {:span, [style: "background-color: black;"]},
"": {:span, [style: "background-color: red;"]},
"": {:span, [style: "background-color: green;"]},
"": {:span, [style: "background-color: yellow;"]},
"": {:span, [style: "background-color: blue;"]},
"": {:span, [style: "background-color: magenta;"]},
"": {:span, [style: "background-color: cyan;"]},
"": {:span, [style: "background-color: white;"]},
"": {:span, [style: "background-color: black;"]},
"": {:span, [class: "has-underline"]},
"": {:span, [style: "text-decoration: line-through;"]},
container: {:pre, [class: "container"]}, name: "My Theme"}

Link to this section Summary

Link to this section Functions