mirror of
https://github.com/c-cube/linol.git
synced 2025-12-06 03:05:31 -05:00
10 lines
3.6 KiB
HTML
10 lines
3.6 KiB
HTML
<!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> » 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>"dumb"</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>"UTF-8"</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">-></span></span>
|
||
<span><span class="optlabel">?utf_8</span>:bool <span class="arrow">-></span></span>
|
||
<span><a href="../../ocaml/Stdlib/index.html#type-out_channel">out_channel</a> <span class="arrow">-></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">-></span></span>
|
||
<span><span class="optlabel">?utf_8</span>:bool <span class="arrow">-></span></span>
|
||
<span>unit <span class="arrow">-></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>
|