11(* * Markup examples. *)
22
33(* * 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}
5+ comprehensive example} of comment placement. This has been replicated in
6+ the module Foo below to show how this is rendered by [odoc]. *)
77
88module 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.*)
1111
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.*)
1515
1616 (* ******************************************************************)
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. *)
1918
2019 (* * The comment for function f. *)
2120 val f : int -> int -> int
2221 (* * The continuation of the comment for function f. *)
2322
2423 (* Hello, I'm a simple comment :-) *)
2524 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.*)
2827
29- (* * Comment for type weather *)
28+ (* * Comment for type weather *)
3029 type weather =
3130 | Rain of int (* * The comment for constructor Rain *)
3231 | Sun (* * The comment for constructor Sun *)
3332
34- (* * Comment for type weather2 *)
33+ (* * Comment for type weather2 *)
3534 type weather2 =
3635 | Rain of int (* * The comment for constructor Rain *)
3736 | 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.*)
4039
4140 (* * The comment for type my_record *)
4241 type my_record = {
@@ -67,9 +66,8 @@ module type Foo = sig
6766 val toto : int
6867 (* * The comment for attribute toto. *)
6968
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. *)
7371
7472 val titi : string
7573
@@ -126,8 +124,8 @@ module Stop : sig
126124 end
127125
128126 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.*)
131129
132130 (* */**)
133131
@@ -137,14 +135,14 @@ module Stop : sig
137135 (* */**)
138136
139137 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". *)
142140end
143141
144142(* * {2 Scoping rules} *)
145143module 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 *)
148146
149147 type t
150148
@@ -155,12 +153,12 @@ module Scope : sig
155153 val y : int
156154
157155 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 *)
164162
165163 val y : string
166164 end
@@ -174,25 +172,27 @@ module Preamble_examples : sig
174172 (* * This is the comment attached to the declaration of Hidden__Module *)
175173 module Hidden__Module : sig
176174 (* * 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 *)
181179
182180 type t
183181 (* * This is a comment on type t *)
184182 end
185183
186184 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+ *)
188187
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+ *)
190190 module Hidden__Module2 : sig
191191 (* * 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 *)
196196
197197 type t
198198 (* * This is a comment on type t *)
@@ -202,23 +202,22 @@ module Preamble_examples : sig
202202
203203 module Nonhidden_module : sig
204204 (* * 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. *)
208207 end
209208
210209 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 *)
212212
213213 module Nonhidden_module2 : sig
214214 (* * 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. *)
218217 end
219218
220219 module Module4 = Nonhidden_module2
221220
222221 (* * 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 *)
224223end
0 commit comments