ocaml-containers/3.13/containers/Containers_pp/Ext/index.html
2023-12-05 15:53:19 -05:00

8 lines
No EOL
3 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>Ext (containers.Containers_pp.Ext)</title><link rel="stylesheet" href="../../../odoc.support/odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.2"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../odoc.support/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">containers</a> &#x00BB; <a href="../index.html">Containers_pp</a> &#x00BB; Ext</nav><header class="odoc-preamble"><h1>Module <code><span>Containers_pp.Ext</span></code></h1><p>Extension node.</p><p>Custom nodes can be used to add user-defined behavior to the rendered output. For example, documents might be annotated with ANSI-terminal colors, or with HTML tags.</p></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-t"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> <span>'a t</span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-make"><a href="#val-make" class="anchor"></a><code><span><span class="keyword">val</span> make :
<span>?width:<span>(<span><span class="type-var">'a</span> <span class="arrow">&#45;&gt;</span></span> int)</span> <span class="arrow">&#45;&gt;</span></span>
<span>name:string <span class="arrow">&#45;&gt;</span></span>
<span>pre:<span>(<span><a href="../Out/index.html#type-t">Out.t</a> <span class="arrow">&#45;&gt;</span></span> <span>inside:<span><span class="type-var">'a</span> option</span> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> <span class="arrow">&#45;&gt;</span></span> unit)</span> <span class="arrow">&#45;&gt;</span></span>
<span>post:<span>(<span><a href="../Out/index.html#type-t">Out.t</a> <span class="arrow">&#45;&gt;</span></span> <span>inside:<span><span class="type-var">'a</span> option</span> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> <span class="arrow">&#45;&gt;</span></span> unit)</span> <span class="arrow">&#45;&gt;</span></span>
<span>unit <span class="arrow">&#45;&gt;</span></span>
<span><span class="type-var">'a</span> <a href="#type-t">t</a></span></span></code></div><div class="spec-doc"><p>An extension is a custom document node. It takes a value of type <code>'a</code>, and a document <code>d</code>, and can output what it wants based on the custom value before and after <code>d</code> is printed.</p><p>The extension is considered to have width <code>0</code>, unless <code>width</code> is specified.</p><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">pre</span> <p>called before the wrapped value is printed</p></li></ul><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">post</span> <p>called after the wrapped value is printed</p></li></ul></div></div></div></body></html>