linol/fmt/Fmt_tty/index.html
2024-05-08 15:15:46 +00:00

10 lines
3.6 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Fmt_tty (fmt.Fmt_tty)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.2"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../index.html">fmt</a> &#x00BB; Fmt_tty</nav><header class="odoc-preamble"><h1>Module <code><span>Fmt_tty</span></code></h1><p><code>Fmt</code> TTY setup.</p><p><code>Fmt_tty</code> provides simple automatic setup on channel formatters for:</p><ul><li><a href="../Fmt/index.html#val-set_style_renderer"><code>Fmt.set_style_renderer</code></a>. <code>`Ansi_tty</code> is used if the channel <span class="xref-unresolved" title="Unix.isatty">is a tty</span> and the environment variable <code>TERM</code> is defined and its value is not <code>&quot;dumb&quot;</code>. <code>`None</code> is used otherwise.</li><li><a href="../Fmt/index.html#val-set_utf_8"><code>Fmt.set_utf_8</code></a>. <code>true</code> is used if one of the following environment variables has <code>&quot;UTF-8&quot;</code> as a case insensitive substring: <code>LANG</code>, <code>LC_ALL</code>, <code>LC_CTYPE</code>.</li></ul></header><nav class="odoc-toc"><ul><li><a href="#tty_setup">TTY setup</a></li></ul></nav><div class="odoc-content"><h2 id="tty_setup"><a href="#tty_setup" class="anchor"></a>TTY setup</h2><div class="odoc-spec"><div class="spec value anchored" id="val-setup"><a href="#val-setup" class="anchor"></a><code><span><span class="keyword">val</span> setup :
<span><span class="optlabel">?style_renderer</span>:<a href="../Fmt/index.html#type-style_renderer">Fmt.style_renderer</a> <span class="arrow">&#45;&gt;</span></span>
<span><span class="optlabel">?utf_8</span>:bool <span class="arrow">&#45;&gt;</span></span>
<span><a href="../../ocaml/Stdlib/index.html#type-out_channel">out_channel</a> <span class="arrow">&#45;&gt;</span></span>
<a href="../../ocaml/Stdlib/Format/index.html#type-formatter">Stdlib.Format.formatter</a></span></code></div><div class="spec-doc"><p><code>setup ?style_renderer ?utf_8 outc</code> is a formatter for <code>outc</code> with <a href="../Fmt/index.html#val-set_style_renderer"><code>Fmt.set_style_renderer</code></a> and <a href="../Fmt/index.html#val-set_utf_8"><code>Fmt.set_utf_8</code></a> correctly setup. If <code>style_renderer</code> or <code>utf_8</code> are specified they override the automatic setup.</p><p>If <code>outc</code> is <code>stdout</code>, <a href="../Fmt/index.html#val-stdout"><code>Fmt.stdout</code></a> is returned. If <code>outc</code> is <code>stderr</code>, <a href="../Fmt/index.html#val-stderr"><code>Fmt.stderr</code></a> is returned.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-setup_std_outputs"><a href="#val-setup_std_outputs" class="anchor"></a><code><span><span class="keyword">val</span> setup_std_outputs :
<span><span class="optlabel">?style_renderer</span>:<a href="../Fmt/index.html#type-style_renderer">Fmt.style_renderer</a> <span class="arrow">&#45;&gt;</span></span>
<span><span class="optlabel">?utf_8</span>:bool <span class="arrow">&#45;&gt;</span></span>
<span>unit <span class="arrow">&#45;&gt;</span></span>
unit</span></code></div><div class="spec-doc"><p><code>setup_std_outputs ?style_renderer ?utf_8 ()</code> applies <a href="#val-setup"><code>setup</code></a> on <code>stdout</code> and <code>stderr</code>.</p></div></div></div></body></html>