package fmt

  1. Overview
  2. Docs
OCaml Format pretty-printer combinators

Install

dune-project
 Dependency

Authors

Maintainers

Sources

fmt-0.11.0.tbz
sha512=3f40155fc6a7315202e410585964307d63416c8001fd243667ed9d8d1a02b67deecacb25e9c2feb409c537bbdfb7817d91168de4ddd643532ff51d6c1c696a4a

doc/fmt.tty/Fmt_tty/index.html

Module Fmt_ttySource

Fmt TTY setup.

Fmt_tty provides simple automatic setup on channel formatters for:

  • Fmt.set_style_renderer. `Ansi_tty is used if the channel is a tty and the environment variable TERM is defined and its value is not "dumb". `None is used otherwise.
  • Fmt.set_utf_8. true is used if one of the following environment variables has "UTF-8" as a case insensitive substring: LANG, LC_ALL, LC_CTYPE.

TTY setup

Sourceval setup : ?style_renderer:Fmt.style_renderer -> ?utf_8:bool -> out_channel -> Format.formatter

setup ?style_renderer ?utf_8 outc is a formatter for outc with Fmt.set_style_renderer and Fmt.set_utf_8 correctly setup. If style_renderer or utf_8 are specified they override the automatic setup.

If outc is stdout, Fmt.stdout is returned. If outc is stderr, Fmt.stderr is returned.

Sourceval setup_std_outputs : ?style_renderer:Fmt.style_renderer -> ?utf_8:bool -> unit -> unit

setup_std_outputs ?style_renderer ?utf_8 () applies setup on stdout and stderr.

OCaml

Innovation. Community. Security.

On This Page
  1. TTY setup