package containers

  1. Overview
  2. Docs
A modular, clean and powerful extension of the OCaml standard library

Install

dune-project
 Dependency

Authors

Maintainers

Sources

containers-3.18.tbz
sha256=52eeff91ce42b52305e6aaa8a58b88ce8f0a5a984199e59ca7e2fd9ebabe61d7
sha512=dc7337e6cbc9850542c7c9228d3bcb4e4add57a55e2a2992f21fb4761b3e10a68ef1d57ca37a7f5b303fc875fe3df5ecb69dbf2930bfcd1561ce03f7ae83e24b

doc/containers/CCFormat/ANSI_codes/index.html

Module CCFormat.ANSI_codesSource

ANSI escape codes. This contains lower level functions for them.

  • since 3.5
Sourcetype color = [
  1. | `Black
  2. | `Red
  3. | `Yellow
  4. | `Green
  5. | `Blue
  6. | `Magenta
  7. | `Cyan
  8. | `White
]

An ANSI color

Sourcetype style = [
  1. | `FG of color
    (*

    foreground

    *)
  2. | `BG of color
    (*

    background

    *)
  3. | `Bold
  4. | `Reset
]

A style. Styles can be composed in a list.

Sourceval clear_line : string

clear_line is an escape code to clear the current line. It is very useful for progress bars; for example:

  let pp_progress i =
    Printf.printf "%sprogress at %d%!" ANSI_codes.clear_line i

if called repeatedly this will print successive progress messages on a single line.

Sourceval reset : string

The escape code to reset style (colors, bold, etc.)

Sourceval string_of_style : style -> string

string_of_style st is an escape code to set the current style to st. It can be printed as is on any output that is a compatible terminal.

Sourceval string_of_style_list : style list -> string

string_of_style_list styles is an escape code for multiple styles at once. For example string_of_style_list ANSI_codes.([`FG `Red; `BG `Green; `Bold]) is a very shiny style.