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