this repo has no description
1<!DOCTYPE html>
2<html xmlns="http://www.w3.org/1999/xhtml">
3 <head><title>Markup (Markup)</title><meta charset="utf-8"/>
4 <link rel="stylesheet" href="odoc.css"/>
5 <meta name="generator" content="odoc %%VERSION%%"/>
6 <meta name="viewport" content="width=device-width,initial-scale=1.0"/>
7 <script src="highlight.pack.js"></script>
8 <script>hljs.initHighlightingOnLoad();</script>
9 <link rel="stylesheet" href="katex.min.css"/>
10 <script src="katex.min.js"></script>
11 <script>
12
13//<![CDATA[
14
15 document.addEventListener("DOMContentLoaded", function () {
16 var macros = {};
17 var elements = Array.from(document.getElementsByClassName("odoc-katex-math"));
18 for (var i = 0; i < elements.length; i++) {
19 var el = elements[i];
20 var content = el.textContent;
21 var new_el = document.createElement("span");
22 new_el.setAttribute("class", "odoc-katex-math-rendered");
23 var display = el.classList.contains("display");
24 katex.render(content, new_el, { throwOnError: false, displayMode: display, macros });
25 el.replaceWith(new_el);
26 }
27 });
28
29//]]>
30
31 </script>
32 </head>
33 <body class="odoc">
34 <nav class="odoc-nav"><a href="index.html">Up</a> –
35 <a href="index.html">Index</a> » Markup
36 </nav>
37 <header class="odoc-preamble">
38 <h1>Module <code><span>Markup</span></code></h1>
39 <p>Here, we test the rendering of comment markup.</p>
40 </header>
41 <div class="odoc-tocs">
42 <nav class="odoc-toc odoc-local-toc">
43 <ul>
44 <li><a href="#sections">Sections</a>
45 <ul>
46 <li><a href="#subsection-headings">Subsection headings</a>
47 <ul>
48 <li><a href="#sub-subsection-headings">Sub-subsection headings</a>
49 </li>
50 <li><a href="#anchors">Anchors</a>
51 <ul>
52 <li><a href="#paragraph">Paragraph</a>
53 <ul><li><a href="#subparagraph">Subparagraph</a></li></ul>
54 </li>
55 </ul>
56 </li>
57 </ul>
58 </li>
59 </ul>
60 </li><li><a href="#styling">Styling</a></li>
61 <li><a href="#links-and-references">Links and references</a></li>
62 <li><a href="#preformatted-text">Preformatted text</a></li>
63 <li><a href="#lists">Lists</a></li>
64 <li><a href="#unicode">Unicode</a></li>
65 <li><a href="#raw-html">Raw HTML</a></li>
66 <li><a href="#math">Math</a></li><li><a href="#modules">Modules</a></li>
67 <li><a href="#tables">Tables</a></li><li><a href="#tags">Tags</a></li>
68 </ul>
69 </nav>
70 </div>
71 <div class="odoc-content">
72 <h2 id="sections"><a href="#sections" class="anchor"></a>Sections</h2>
73 <p>Let's get these done first, because sections will be used to break
74 up the rest of this test.
75 </p><p>Besides the section heading above, there are also</p>
76 <h3 id="subsection-headings">
77 <a href="#subsection-headings" class="anchor"></a>Subsection headings
78 </h3><p>and</p>
79 <h4 id="sub-subsection-headings">
80 <a href="#sub-subsection-headings" class="anchor"></a>Sub-subsection
81 headings
82 </h4>
83 <p>but odoc has banned deeper headings. There are also title headings,
84 but they are only allowed in mld files.
85 </p><h4 id="anchors"><a href="#anchors" class="anchor"></a>Anchors</h4>
86 <p>Sections can have attached
87 <a href="#anchors" title="anchors">Anchors</a>, and it is possible
88 to <a href="#anchors" title="anchors">link</a> to them. Links to
89 section headers should not be set in source code style.
90 </p>
91 <h5 id="paragraph"><a href="#paragraph" class="anchor"></a>Paragraph</h5>
92 <p>Individual paragraphs can have a heading.</p>
93 <h6 id="subparagraph"><a href="#subparagraph" class="anchor"></a>
94 Subparagraph
95 </h6>
96 <p>Parts of a longer paragraph that can be considered alone can also
97 have headings.
98 </p><h2 id="styling"><a href="#styling" class="anchor"></a>Styling</h2>
99 <p>This paragraph has some styled elements: <b>bold</b> and <i>italic</i>
100 , <b><i>bold italic</i></b>, <em>emphasis</em>,
101 <em><em class="odd">emphasis</em> within emphasis</em>,
102 <b><i>bold italic</i></b>, super<sup>script</sup>, sub<sub>script</sub>
103 . The line spacing should be enough for superscripts and subscripts
104 not to look odd.
105 </p>
106 <p>Note:
107 <i>In italics <em>emphasis</em> is rendered as normal text while
108 <em>emphasis <em class="odd">in</em> emphasis</em> is rendered in
109 italics.
110 </i>
111 <i>It also work the same in
112 <a href="#">links in italics with
113 <em>emphasis <em class="odd">in</em> emphasis</em>.
114 </a>
115 </i>
116 </p>
117 <p><code>code</code> is a different kind of markup that doesn't allow
118 nested markup.
119 </p>
120 <p>It's possible for two markup elements to appear <b>next</b> <i>to</i>
121 each other and have a space, and appear <b>next</b><i>to</i> each
122 other with no space. It doesn't matter <b>how</b> <i>much</i> space
123 it was in the source: in this sentence, it was two space characters.
124 And in this one, there is <b>a</b> <i>newline</i>.
125 </p>
126 <p>This is also true between <em>non-</em><code>code</code> markup
127 <em>and</em> <code>code</code>.
128 </p>
129 <p>Code can appear <b>inside <code>other</code> markup</b>. Its display
130 shouldn't be affected.
131 </p>
132 <p>There is no differences between <code>a b</code> and <code>a b</code>.
133 </p>
134 <p>Consecutive whitespaces not after a newline are conserved as they
135 are: <code>a b</code>.
136 </p>
137 <h2 id="links-and-references">
138 <a href="#links-and-references" class="anchor"></a>Links and references
139 </h2>
140 <p>This is a <a href="#">link</a>. It sends you to the top of this
141 page. Links can have markup inside them: <a href="#"><b>bold</b></a>
142 , <a href="#"><i>italics</i></a>, <a href="#"><em>emphasis</em></a>
143 , <a href="#">super<sup>script</sup></a>,
144 <a href="#">sub<sub>script</sub></a>, and
145 <a href="#"><code>code</code></a>. Links can also be nested
146 <em><a href="#">inside</a></em> markup. Links cannot be nested inside
147 each other. This link has no replacement text: <a href="#">#</a>
148 . The text is filled in by odoc. This is a shorthand link:
149 <a href="#">#</a>. The text is also filled in by odoc in this case.
150 </p>
151 <p>This is a reference to <a href="#val-foo"><code>foo</code></a>.
152 References can have replacement text:
153 <a href="#val-foo" title="foo">the value foo</a>. Except for the
154 special lookup support, references are pretty much just like links.
155 The replacement text can have nested styles:
156 <a href="#val-foo" title="foo"><b>bold</b></a>,
157 <a href="#val-foo" title="foo"><i>italic</i></a>,
158 <a href="#val-foo" title="foo"><em>emphasis</em></a>,
159 <a href="#val-foo" title="foo">super<sup>script</sup></a>,
160 <a href="#val-foo" title="foo">sub<sub>script</sub></a>, and
161 <a href="#val-foo" title="foo"><code>code</code></a>. It's also possible
162 to surround a reference in a style:
163 <b><a href="#val-foo"><code>foo</code></a></b>. References can't
164 be nested inside references, and links and references can't be nested
165 inside each other.
166 </p>
167 <h2 id="preformatted-text">
168 <a href="#preformatted-text" class="anchor"></a>Preformatted text
169 </h2><p>This is a code block:</p>
170 <div>
171 <pre class="language-ocaml">
172 <code>
173 let foo = ()
174 (** There are some nested comments in here, but an unpaired comment
175 terminator would terminate the whole doc surrounding comment.
176 It's
177 best to keep code blocks no wider than 72 characters. *)
178
179 let bar =
180 ignore foo
181 </code>
182 </pre>
183 </div><p>There are also verbatim blocks:</p>
184 <pre>The main difference is these don't get syntax highlighting.</pre>
185 <h2 id="lists"><a href="#lists" class="anchor"></a>Lists</h2>
186 <ul><li>This is a</li><li>shorthand bulleted list,</li>
187 <li>and the paragraphs in each list item support <em>styling</em>.</li>
188 </ul><ol><li>This is a</li><li>shorthand numbered list.</li></ol>
189 <ul>
190 <li>Shorthand list items can span multiple lines, however trying
191 to put two paragraphs into a shorthand list item using a double
192 line break
193 </li>
194 </ul><p>just creates a paragraph outside the list.</p>
195 <ul><li>Similarly, inserting a blank line between two list items</li></ul>
196 <ul><li>creates two separate lists.</li></ul>
197 <ul>
198 <li><p>To get around this limitation, one</p>
199 <p>can use explicitly-delimited lists.</p>
200 </li><li>This one is bulleted,</li>
201 </ul><ol><li>but there is also the numbered variant.</li></ol>
202 <ul>
203 <li>
204 <ul><li>lists</li><li>can be nested</li>
205 <li>and can include references</li>
206 <li><a href="#val-foo"><code>foo</code></a></li>
207 </ul>
208 </li>
209 </ul><h2 id="unicode"><a href="#unicode" class="anchor"></a>Unicode</h2>
210 <p>The parser supports any ASCII-compatible encoding.</p>
211 <p>In particuλar UTF-8.</p>
212 <h2 id="raw-html"><a href="#raw-html" class="anchor"></a>Raw HTML</h2>
213 <p>Raw HTML can be <input type="text" placeholder="inserted"> as inline
214 elements into sentences.
215 </p>
216
217 <blockquote>
218 If the raw HTML is the only thing in a paragraph, it is treated as a block
219 element, and won't be wrapped in paragraph tags by the HTML generator.
220 </blockquote>
221
222 <h2 id="math"><a href="#math" class="anchor"></a>Math</h2>
223 <p>Math elements can be inline:
224 <code class="odoc-katex-math">\int_{-\infty}^\infty</code>, or blocks:
225 </p>
226 <div>
227 <pre class="odoc-katex-math display">
228 % \f is defined as #1f(#2) using the macro
229 \newcommand{\f}[2]{#1f(#2)}
230 \f\relax{x} = \int_{-\infty}^\infty
231 \f\hat\xi\,e^{2 \pi i \xi x}
232 \,d\xi
233
234 </pre>
235 </div><h2 id="modules"><a href="#modules" class="anchor"></a>Modules</h2>
236 <ul class="modules"><li><a href="Markup-X.html"><code>X</code></a> </li>
237 </ul>
238 <ul class="modules"><li><a href="Markup-X.html"><code>X</code></a> </li>
239 <li><a href="Markup-Y.html"><code>Y</code></a> </li>
240 </ul><h2 id="tables"><a href="#tables" class="anchor"></a>Tables</h2>
241 <table class="odoc-table">
242 <tr><th style="text-align:left"><p>Left</p></th>
243 <th style="text-align:center"><p>Center</p></th>
244 <th style="text-align:right"><p>Right</p></th><th><p>Default</p></th>
245 </tr>
246 <tr><td style="text-align:left"><p>A</p></td>
247 <td style="text-align:center"><p>B</p></td>
248 <td style="text-align:right"><p>C</p></td><td><p>D</p></td>
249 </tr>
250 </table>
251 <table class="odoc-table">
252 <tr><th style="text-align:left"><p>Left</p></th>
253 <th style="text-align:center"><p>Center</p></th>
254 <th style="text-align:right"><p>Right</p></th><th><p>Default</p></th>
255 </tr>
256 <tr><td style="text-align:left"><p>A</p></td>
257 <td style="text-align:center"><p>B</p></td>
258 <td style="text-align:right"><p>C</p></td><td><p>D</p></td>
259 </tr>
260 <tr>
261 <td style="text-align:left">
262 <p>A much longer paragraph which will need to be wrapped and more
263 content and more content and some different content and we will
264 see what is does if we can see it
265 </p>
266 </td>
267 <td style="text-align:center">
268 <p>B much longer paragraph which will need to be wrapped and more
269 content and more content and some different content and we will
270 see what is does if we can see it
271 </p>
272 </td>
273 <td style="text-align:right">
274 <p>C much longer paragraph which will need to be wrapped and more
275 content and more content and some different content and we will
276 see what is does if we can see it
277 </p>
278 </td>
279 <td>
280 <p>D much longer paragraph which will need to be wrapped and more
281 content and more content and some different content and we will
282 see what is does if we can see it
283 </p>
284 </td>
285 </tr>
286 </table>
287 <table class="odoc-table">
288 <tr><td><p>No</p></td><td><p>Header</p></td></tr>
289 <tr><td><p>A</p></td><td><p>B</p></td></tr>
290 </table>
291 <table class="odoc-table">
292 <tr><th><p>Header 1</p></th><th><p>Header 2</p></th></tr>
293 <tr><td><p>Data 1</p></td><td><p>Data 2</p></td></tr>
294 </table>
295 <table class="odoc-table">
296 <tr><th><p>Header 1</p></th><td><p>Data 1</p></td></tr>
297 <tr><th><p>Header 2</p></th><td><p>Data 2</p></td></tr>
298 </table><h2 id="tags"><a href="#tags" class="anchor"></a>Tags</h2>
299 <p>Each comment can end with zero or more tags. Here are some examples:
300 </p>
301 <ul class="at-tags">
302 <li class="author"><span class="at-tag">author</span> antron</li>
303 </ul>
304 <ul class="at-tags">
305 <li class="deprecated"><span class="at-tag">deprecated</span>
306 <p>a <em>long</em> time ago</p>
307 </li>
308 </ul>
309 <ul class="at-tags">
310 <li class="parameter"><span class="at-tag">parameter</span>
311 <span class="value">foo</span> <p>unused</p>
312 </li>
313 </ul>
314 <ul class="at-tags">
315 <li class="raises"><span class="at-tag">raises</span>
316 <code>Failure</code> <p>always</p>
317 </li>
318 </ul>
319 <ul class="at-tags">
320 <li class="returns"><span class="at-tag">returns</span> <p>never</p></li>
321 </ul>
322 <ul class="at-tags">
323 <li class="see"><span class="at-tag">see</span>
324 <a href="#" class="value">#</a> <p>this url</p>
325 </li>
326 </ul>
327 <ul class="at-tags">
328 <li class="see"><span class="at-tag">see</span>
329 <code class="value">foo.ml</code> <p>this file</p>
330 </li>
331 </ul>
332 <ul class="at-tags">
333 <li class="see"><span class="at-tag">see</span>
334 <span class="value">Foo</span> <p>this document</p>
335 </li>
336 </ul>
337 <ul class="at-tags">
338 <li class="since"><span class="at-tag">since</span> 0</li>
339 </ul>
340 <ul class="at-tags">
341 <li class="before"><span class="at-tag">before</span>
342 <span class="value">1.0</span>
343 <p>it was in b<sup>e</sup>t<sub>a</sub></p>
344 </li>
345 </ul>
346 <ul class="at-tags">
347 <li class="version"><span class="at-tag">version</span> -1</li>
348 </ul>
349 <div class="odoc-spec">
350 <div class="spec value anchored" id="val-foo">
351 <a href="#val-foo" class="anchor"></a>
352 <code><span><span class="keyword">val</span> foo : unit</span></code>
353 </div>
354 <div class="spec-doc">
355 <p>Comments in structure items <b>support</b> <em>markup</em>, t
356 <sup>o</sup><sub>o</sub>.
357 </p>
358 </div>
359 </div><p>Some modules to support references.</p>
360 <div class="odoc-spec">
361 <div class="spec module anchored" id="module-X">
362 <a href="#module-X" class="anchor"></a>
363 <code>
364 <span><span class="keyword">module</span> <a href="Markup-X.html">X</a>
365 </span>
366 <span> : <span class="keyword">sig</span> ...
367 <span class="keyword">end</span>
368 </span>
369 </code>
370 </div>
371 </div>
372 <div class="odoc-spec">
373 <div class="spec module anchored" id="module-Y">
374 <a href="#module-Y" class="anchor"></a>
375 <code>
376 <span><span class="keyword">module</span> <a href="Markup-Y.html">Y</a>
377 </span>
378 <span> : <span class="keyword">sig</span> ...
379 <span class="keyword">end</span>
380 </span>
381 </code>
382 </div>
383 </div>
384 </div>
385 </body>
386</html>