wolfadex/elm-ansi/2.0.0

NOTE: the latest version is 3.0.1

Ansi.Font

When styling your terminal there are 2 sets of commands, those that add the style and those that remove it. This does make this a little more difficult to use as you have to remember to reset each style when you no longer want it applied. It does however let you mix and match styles however you want. For example

Ansi.Font.startItalic ++ "Hello, " ++ Ansi.Font.startBold ++ "World" ++ Ansi.Font.endBold ++ "!" ++ Ansi.Font.endItalic

produces "Hello, World!". However most people don't need this fine grained of control. If you want simpler functions I recommend

Ansi.Font.italic ("Hello, " ++ Ansi.Font.bold "World" ++ "!")

which produces the same result.

Shorthand Styling

bold : String -> String
faint : String -> String

The opposite of bold

italic : String -> String
underline : String -> String
strikeThrough : String -> String

Explicit Styling

startBold : String
endBold : String

Double-underline per ECMA-48, but instead disables bold intensity on several terminals, including in the Linux kernel's console before version 4.17.

startFaint : String

The opposite of bold

endBoldFaint : String
startItalic : String
endItalic : String
endUnderline : String
resetAll : String

Visibility

hide : String
show : String

Limited Support

These have some limited support but it varies greatly by terminal