1
1
(* * Markup examples. *)
2
2
3
3
(* * The OCaml manual gives a
4
- {{:https://ocaml.org/manual/ocamldoc.html#ss:ocamldoc-placement}comprehensive example}
5
- of comment placement. This has been replicated in the module Foo below to
6
- show how this is rendered by [odoc]. *)
4
+ {{:https://ocaml.org/manual/ocamldoc.html#ss:ocamldoc-placement}comprehensive
5
+ example} of comment placement. This has been replicated in the module Foo
6
+ below to show how this is rendered by [odoc]. *)
7
7
8
8
module type Foo = sig
9
- (* * The first special comment of the file is the comment associated
10
- with the whole module.*)
9
+ (* * The first special comment of the file is the comment associated with the
10
+ whole module.*)
11
11
12
- (* * Special comments can be placed between elements and are kept
13
- by the OCamldoc tool, but are not associated to any element.
14
- [@]-tags in these comments are ignored.*)
12
+ (* * Special comments can be placed between elements and are kept by the
13
+ OCamldoc tool, but are not associated to any element. [@]-tags in these
14
+ comments are ignored.*)
15
15
16
16
(* ******************************************************************)
17
- (* * Comments like the one above, with more than two asterisks,
18
- are ignored. *)
17
+ (* * Comments like the one above, with more than two asterisks, are ignored. *)
19
18
20
19
(* * The comment for function f. *)
21
20
val f : int -> int -> int
22
21
(* * The continuation of the comment for function f. *)
23
22
24
23
(* Hello, I'm a simple comment :-) *)
25
24
exception My_exception of (int -> int ) * int
26
- (* * Comment for exception My_exception, even with a simple comment
27
- between the special comment and the exception.*)
25
+ (* * Comment for exception My_exception, even with a simple comment between the
26
+ special comment and the exception.*)
28
27
29
- (* * Comment for type weather *)
28
+ (* * Comment for type weather *)
30
29
type weather =
31
30
| Rain of int (* * The comment for constructor Rain *)
32
31
| Sun (* * The comment for constructor Sun *)
33
32
34
- (* * Comment for type weather2 *)
33
+ (* * Comment for type weather2 *)
35
34
type weather2 =
36
35
| Rain of int (* * The comment for constructor Rain *)
37
36
| Sun (* * The comment for constructor Sun *)
38
- (* * I can continue the comment for type weather2 here
39
- because there is already a comment associated to the last constructor.*)
37
+ (* * I can continue the comment for type weather2 here because there is already
38
+ a comment associated to the last constructor.*)
40
39
41
40
(* * The comment for type my_record *)
42
41
type my_record = {
@@ -67,9 +66,8 @@ module type Foo = sig
67
66
val toto : int
68
67
(* * The comment for attribute toto. *)
69
68
70
- (* * This comment is not attached to titi since
71
- there is a blank line before titi, but is kept
72
- as a comment in the class. *)
69
+ (* * This comment is not attached to titi since there is a blank line before
70
+ titi, but is kept as a comment in the class. *)
73
71
74
72
val titi : string
75
73
@@ -126,8 +124,8 @@ module Stop : sig
126
124
end
127
125
128
126
val foo : string
129
- (* * This value appears in the documentation, since the Stop special comment
130
- in the class does not affect the parent module of the class.*)
127
+ (* * This value appears in the documentation, since the Stop special comment in
128
+ the class does not affect the parent module of the class.*)
131
129
132
130
(* */**)
133
131
@@ -137,14 +135,14 @@ module Stop : sig
137
135
(* */**)
138
136
139
137
type t = string
140
- (* * The type t appears since in the documentation since the previous stop comment
141
- toggled off the "no documentation mode". *)
138
+ (* * The type t appears since in the documentation since the previous stop
139
+ comment toggled off the "no documentation mode". *)
142
140
end
143
141
144
142
(* * {2 Scoping rules} *)
145
143
module Scope : sig
146
- (* * In this floating comment I can refer to type {!t} and value {!v}
147
- declared later in the signature *)
144
+ (* * In this floating comment I can refer to type {!t} and value {!v} declared
145
+ later in the signature *)
148
146
149
147
type t
150
148
@@ -155,12 +153,12 @@ module Scope : sig
155
153
val y : int
156
154
157
155
module A : sig
158
- (* * In this module I can refer to val {!x} declared above as well as
159
- type {!u} declared later in the parent module. Elements declared
160
- in this signature take priority, so {!y} refers to {!A.y} as
161
- opposed to the [y] declared in the parent signature.
162
-
163
- @see 'markup.mli' for a good time *)
156
+ (* * In this module I can refer to val {!x} declared above as well as type
157
+ {!u} declared later in the parent module. Elements declared in this
158
+ signature take priority, so {!y} refers to {!A.y} as opposed to the [y]
159
+ declared in the parent signature.
160
+
161
+ @see 'markup.mli' for a good time *)
164
162
165
163
val y : string
166
164
end
@@ -174,25 +172,27 @@ module Preamble_examples : sig
174
172
(* * This is the comment attached to the declaration of Hidden__Module *)
175
173
module Hidden__Module : sig
176
174
(* * This is the top comment declared in the module Hidden__module.
177
-
178
- This is the second paragraph in the module Hidden__module.
179
-
180
- @canonical Odoc_examples.Markup.Module *)
175
+
176
+ This is the second paragraph in the module Hidden__module.
177
+
178
+ @canonical Odoc_examples.Markup.Module *)
181
179
182
180
type t
183
181
(* * This is a comment on type t *)
184
182
end
185
183
186
184
module Module = Hidden__Module
187
- (* * This comment is on the declaration of Module as an alias of Hidden__Module *)
185
+ (* * This comment is on the declaration of Module as an alias of Hidden__Module
186
+ *)
188
187
189
- (* * This is the comment attached to the declaration of module Hidden__Module2 *)
188
+ (* * This is the comment attached to the declaration of module Hidden__Module2
189
+ *)
190
190
module Hidden__Module2 : sig
191
191
(* * This is the top comment declared in the module Hidden__module2.
192
-
193
- This is the second paragraph in the module Hidden__module2.
194
-
195
- @canonical Odoc_examples.Markup.Module2 *)
192
+
193
+ This is the second paragraph in the module Hidden__module2.
194
+
195
+ @canonical Odoc_examples.Markup.Module2 *)
196
196
197
197
type t
198
198
(* * This is a comment on type t *)
@@ -202,23 +202,22 @@ module Preamble_examples : sig
202
202
203
203
module Nonhidden_module : sig
204
204
(* * This is the top comment declared in the module Hidden__module2.
205
-
206
- This is the second paragraph in the module Hidden__module2.
207
- *)
205
+
206
+ This is the second paragraph in the module Hidden__module2. *)
208
207
end
209
208
210
209
module Module3 = Nonhidden_module
211
- (* * This comment is on the declaration of Module3 as an alias of Nonhidden_module *)
210
+ (* * This comment is on the declaration of Module3 as an alias of
211
+ Nonhidden_module *)
212
212
213
213
module Nonhidden_module2 : sig
214
214
(* * This is the top comment declared in the module Hidden__module2.
215
-
216
- This is the second paragraph in the module Hidden__module2.
217
- *)
215
+
216
+ This is the second paragraph in the module Hidden__module2. *)
218
217
end
219
218
220
219
module Module4 = Nonhidden_module2
221
220
222
221
(* * The [modules] special reference can be used to refer to a list of modules.
223
- It uses the synopsis from the modules *)
222
+ It uses the synopsis from the modules *)
224
223
end
0 commit comments