summaryrefslogtreecommitdiff
path: root/testsuite/tests/tool-ocamldoc/Linebreaks.html.reference
blob: 66b0dd9df2186fdbbdc2d5484be885523d7de8c6 (plain)
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
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="Start" href="index.html">
<link rel="Up" href="index.html">
<link title="Index of types" rel=Appendix href="index_types.html">
<link title="Index of extensions" rel=Appendix href="index_extensions.html">
<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
<link title="Index of values" rel=Appendix href="index_values.html">
<link title="Index of class types" rel=Appendix href="index_class_types.html">
<link title="Index of modules" rel=Appendix href="index_modules.html">
<link title="Index of module types" rel=Appendix href="index_module_types.html">
<link title="Linebreaks" rel="Chapter" href="Linebreaks.html"><title>Linebreaks</title>
</head>
<body>
<div class="navbar">&nbsp;<a class="up" href="index.html" title="Index">Up</a>
&nbsp;</div>
<h1>Module <a href="type_Linebreaks.html">Linebreaks</a></h1>

<pre><span id="MODULELinebreaks"><span class="keyword">module</span> Linebreaks</span>: <code class="code"><span class="keyword">sig</span></code> <a href="Linebreaks.html">..</a> <code class="code"><span class="keyword">end</span></code></pre><div class="info module top">
<div class="info-desc">
<p>This file tests the encoding of linebreak inside OCaml code by the
   ocamldoc html backend.</p>

<p>Two slightly different aspects are tested in this very file.</p>

<ul>
<li>First, inside a "pre" tags, blanks character should not be escaped.
   For instance, the generated html code for this test fragment should not
   contain any &lt;br&gt; tag:
   <pre class="codepre"><code class="code">     <span class="keyword">let</span> f x =
       <span class="keyword">let</span> g x =
         <span class="keyword">let</span> h x = x <span class="keyword">in</span>
         h x <span class="keyword">in</span>
       g x
   </code></pre>
   See <a href="http://caml.inria.fr/mantis/view.php?id=6341"> MPR#6341</a> for more
   details or the file Linebreaks.html generated by ocamldoc from this file.</li>
<li>Second, outside of a "pre"  tags, blank characters in embedded code
   should be escaped, in order to make them render in a "pre"-like fashion.
   A good example should be the files type_<i>Modulename</i>.html generated by
   ocamldoc that should contains the signature of the module <code class="code"><span class="constructor">Modulename</span></code> in
   a "code" tags.
   For instance with the following type definitions,</li>
</ul>
</div>
</div>
<hr width="100%">

<pre><code><span id="TYPEa"><span class="keyword">type</span> <code class="type"></code>a</span> = </code></pre><table class="typetable">
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTa.A"><span class="constructor">A</span></span></code></td>

</tr></table>



<pre><code><span id="TYPEb"><span class="keyword">type</span> <code class="type">'a</code> b</span> = {</code></pre><table class="typetable">
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTb.field">field</span>&nbsp;: <code class="type">'a</code>;</code></td>

</tr></table>
<code>}</code>



<pre><code><span id="TYPEc"><span class="keyword">type</span> <code class="type"></code>c</span> = </code></pre><table class="typetable">
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTc.C"><span class="constructor">C</span></span> <span class="keyword">:</span> <code class="type">'a</code> <span class="keyword">-></span> <code class="type"><a href="Linebreaks.html#TYPEc">c</a></code></code></td>

</tr></table>



<pre><span id="TYPEs"><span class="keyword">type</span> <code class="type"></code>s</span> = ..</pre>

<pre><code><span class="keyword">type</span> <code class="type"></code><a href="Linebreaks.html#TYPEs">s</a> += </code></pre><table class="typetable">
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="EXTENSIONB">B</span></code></td>

</tr></table>



<pre><span id="VALx"><span class="keyword">val</span> x</span> : <code class="type"><a href="Linebreaks.html#TYPEa">a</a></code></pre>
<pre><span id="MODULES"><span class="keyword">module</span> <a href="Linebreaks.S.html">S</a></span>: <code class="code"><span class="keyword">sig</span></code> <a href="Linebreaks.S.html">..</a> <code class="code"><span class="keyword">end</span></code></pre>
<pre><span id="MODULETYPEs"><span class="keyword">module type</span> <a href="Linebreaks.s-c.html">s</a></span> = <code class="code"><span class="keyword">sig</span></code> <a href="Linebreaks.s-c.html">..</a> <code class="code"><span class="keyword">end</span></code></pre>
<pre><span id="TYPEd"><span class="keyword">class type</span> <a href="Linebreaks.d-c.html">d</a></span> = <code class="code"><span class="keyword">object</span></code> <a href="Linebreaks.d-c.html">..</a> <code class="code"><span class="keyword">end</span></code></pre>
<pre><span id="EXCEPTIONE"><span class="keyword">exception</span> E</span> <span class="keyword">of</span> <code>{</code><table class="typetable">
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTLinebreaks.E.inline">inline</span>&nbsp;: <code class="type">int</code>;</code></td>

</tr></table>
<code>}</code>
</pre>
<p>type_Linebreaks.html should contain</p>

<pre class="codepre"><code class="code"><span class="keyword">sig</span>
  <span class="keyword">type</span> a = <span class="constructor">A</span>
  <span class="keyword">type</span> <span class="keywordsign">'</span>a b = { field : <span class="keywordsign">'</span>a; }
  <span class="keyword">type</span> c = <span class="constructor">C</span> : <span class="keywordsign">'</span>a <span class="keywordsign">-&gt;</span> <span class="constructor">Linebreaks</span>.c
  <span class="keyword">type</span> s = ..
  <span class="keyword">type</span> s += <span class="constructor">B</span>
  <span class="keyword">val</span> x : <span class="constructor">Linebreaks</span>.a
  <span class="keyword">module</span> <span class="constructor">S</span> : <span class="keyword">sig</span> <span class="keyword">module</span> <span class="constructor">I</span> : <span class="keyword">sig</span>  <span class="keyword">end</span> <span class="keyword">end</span>
  <span class="keyword">module</span> <span class="keyword">type</span> s = <span class="keyword">sig</span>  <span class="keyword">end</span>
  <span class="keyword">class</span> <span class="keyword">type</span> d = <span class="keyword">object</span>  <span class="keyword">end</span>
  <span class="keyword">exception</span> <span class="constructor">E</span> <span class="keyword">of</span> { inline : int; }
<span class="keyword">end</span>
</code></pre>
<p>with &lt;br&gt; tags used for linebreaks.
Another example would be <code class="code">&nbsp;<span class="keyword">let</span>&nbsp;f&nbsp;x&nbsp;=<br>
x</code> which is rendered with a &lt;br&gt; linebreak inside Linebreaks.html.</p>

<p>See <a href="http://caml.inria.fr/mantis/view.php?id=7272">MPR#7272</a> for more
information.</p>
</body></html>