package ansi-parse

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

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

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

Styles are applied to 'as or further subtrees.

val default : style

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

val 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.