package ansi-parse

  1. Overview
  2. Docs

Module Ansiparse.AbstractSource

This module translates concrete item lists into an abstract tree structure.

Sourcetype weight =
  1. | Normal
  2. | Bold
  3. | Faint
Sourcetype style = {
  1. weight : weight;
  2. italic : bool;
  3. underline : bool;
  4. reverse : bool;
  5. strike : bool;
  6. foreground : color option;
  7. background : color option;
}
Sourcetype 'a t =
  1. | Base of 'a
  2. | Styled of style * 'a t list

Styles are applied to 'as or further subtrees.

Sourceval default : style

The style of the root of the structure; gives plain text

Sourceval parse : Concrete.t list -> string t

Converts item lists into trees of styled text. Styles applied to strings will nest until a Reset is encountered, after which a new branch from the root is begun.

OCaml

Innovation. Community. Security.