File: Markup.html

package info (click to toggle)
ocaml-odoc 2.1.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 6,744 kB
  • sloc: ml: 37,049; makefile: 124; sh: 79
file content (274 lines) | stat: -rw-r--r-- 11,065 bytes parent folder | download
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
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
 <head><title>Markup (Markup)</title><link rel="stylesheet" href="odoc.css"/>
  <meta charset="utf-8"/><meta name="generator" content="odoc 2.1.1"/>
  <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">
  <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="#modules">Modules</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">Anchors</a>, and 
    it is possible to <a href="#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="#">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="#">link</a>. It sends you to the top of this
     page. Links can have markup inside them: <a href="#"><b>bold</b></a>
    , <a href="#"><i>italics</i></a>, <a href="#"><em>emphasis</em></a>
    , <a href="#">super<sup>script</sup></a>, 
    <a href="#">sub<sub>script</sub></a>, and 
    <a href="#"><code>code</code></a>. Links can also be nested 
    <em><a href="#">inside</a></em> markup. Links cannot be nested inside
     each other. This link has no replacement text: <a href="#">#</a>
    . The text is filled in by odoc. This is a shorthand link: 
    <a href="#">#</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">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"><b>bold</b></a>,
     <a href="#val-foo"><i>italic</i></a>, 
    <a href="#val-foo"><em>emphasis</em></a>, 
    <a href="#val-foo">super<sup>script</sup></a>, 
    <a href="#val-foo">sub<sub>script</sub></a>, and 
    <a href="#val-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>
    <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="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="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> 
     <span class="value">Failure</span> <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="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" id="val-foo" class="anchored">
     <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" id="module-X" class="anchored">
     <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" id="module-Y" class="anchored">
     <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>