@@ -540,10 +540,10 @@ module Make (Syntax : SYNTAX) = struct
540
540
@ O. documentedSrc
541
541
(if Syntax.Type. type_def_semicolon then O. txt " ;" else O. noop)
542
542
in
543
- let kind = Some " extension" in
543
+ let attr = [ " type " ; " extension" ] in
544
544
let anchor = None in
545
545
let doc = Comment. to_ir t.doc in
546
- Item. Declaration { kind ; anchor; doc; content }
546
+ Item. Declaration { attr ; anchor; doc; content }
547
547
548
548
let exn (t : Odoc_model.Lang.Exception.t ) =
549
549
let cstr = constructor (t.id :> Paths.Identifier.t ) t.args t.res in
@@ -553,10 +553,10 @@ module Make (Syntax : SYNTAX) = struct
553
553
@ O. documentedSrc
554
554
(if Syntax.Type.Exception. semicolon then O. txt " ;" else O. noop)
555
555
in
556
- let kind = Some " exception" in
556
+ let attr = [ " exception" ] in
557
557
let anchor = path_to_id t.id in
558
558
let doc = Comment. to_ir t.doc in
559
- Item. Declaration { kind ; anchor; doc; content }
559
+ Item. Declaration { attr ; anchor; doc; content }
560
560
561
561
let polymorphic_variant ~type_ident
562
562
(t : Odoc_model.Lang.TypeExpr.Polymorphic_variant.t ) =
@@ -748,10 +748,10 @@ module Make (Syntax : SYNTAX) = struct
748
748
@ O. documentedSrc
749
749
(if Syntax.Type. type_def_semicolon then O. txt " ;" else O. noop)
750
750
in
751
- let kind = Some (if is_substitution then " type- subst" else " type " ) in
751
+ let attr = " type " :: (if is_substitution then [ " subst" ] else [] ) in
752
752
let anchor = path_to_id t.id in
753
753
let doc = Comment. to_ir t.doc in
754
- Item. Declaration { kind ; anchor; doc; content }
754
+ Item. Declaration { attr ; anchor; doc; content }
755
755
end
756
756
757
757
open Type_declaration
@@ -771,10 +771,10 @@ module Make (Syntax : SYNTAX) = struct
771
771
++ type_expr t.type_
772
772
++ if Syntax.Value. semicolon then O. txt " ;" else O. noop )
773
773
in
774
- let kind = Some " value" in
774
+ let attr = [ " value" ] in
775
775
let anchor = path_to_id t.id in
776
776
let doc = Comment. to_ir t.doc in
777
- Item. Declaration { kind ; anchor; doc; content }
777
+ Item. Declaration { attr ; anchor; doc; content }
778
778
779
779
let external_ (t : Odoc_model.Lang.External.t ) =
780
780
let name = Paths.Identifier. name t.id in
@@ -786,10 +786,10 @@ module Make (Syntax : SYNTAX) = struct
786
786
++ type_expr t.type_
787
787
++ if Syntax.Type.External. semicolon then O. txt " ;" else O. noop )
788
788
in
789
- let kind = Some " external" in
789
+ let attr = [ " value " ; " external" ] in
790
790
let anchor = path_to_id t.id in
791
791
let doc = Comment. to_ir t.doc in
792
- Item. Declaration { kind ; anchor; doc; content }
792
+ Item. Declaration { attr ; anchor; doc; content }
793
793
end
794
794
795
795
open Value
@@ -887,10 +887,10 @@ module Make (Syntax : SYNTAX) = struct
887
887
++ O. txt Syntax.Type. annotation_separator
888
888
++ type_expr t.type_ )
889
889
in
890
- let kind = Some " method" in
890
+ let attr = [ " method" ] in
891
891
let anchor = path_to_id t.id in
892
892
let doc = Comment. to_ir t.doc in
893
- Item. Declaration { kind ; anchor; doc; content }
893
+ Item. Declaration { attr ; anchor; doc; content }
894
894
895
895
let instance_variable (t : Odoc_model.Lang.InstanceVariable.t ) =
896
896
let name = Paths.Identifier. name t.id in
@@ -906,26 +906,26 @@ module Make (Syntax : SYNTAX) = struct
906
906
++ O. txt Syntax.Type. annotation_separator
907
907
++ type_expr t.type_ )
908
908
in
909
- let kind = Some " instance-variable" in
909
+ let attr = [ " value " ; " instance-variable" ] in
910
910
let anchor = path_to_id t.id in
911
911
let doc = Comment. to_ir t.doc in
912
- Item. Declaration { kind ; anchor; doc; content }
912
+ Item. Declaration { attr ; anchor; doc; content }
913
913
914
914
let inherit_ cte =
915
915
let content =
916
916
O. documentedSrc (O. keyword " inherit" ++ O. txt " " ++ class_type_expr cte)
917
917
in
918
- let kind = Some " inherit" in
918
+ let attr = [ " inherit" ] in
919
919
let anchor = None in
920
920
let doc = [] in
921
- Item. Declaration { kind ; anchor; doc; content }
921
+ Item. Declaration { attr ; anchor; doc; content }
922
922
923
923
let constraint_ t1 t2 =
924
924
let content = O. documentedSrc (format_constraints [ (t1, t2) ]) in
925
- let kind = None in
925
+ let attr = [] in
926
926
let anchor = None in
927
927
let doc = [] in
928
- Item. Declaration { kind ; anchor; doc; content }
928
+ Item. Declaration { attr ; anchor; doc; content }
929
929
930
930
let class_signature (c : Lang.ClassSignature.t ) =
931
931
let rec loop l acc_items =
@@ -1002,10 +1002,10 @@ module Make (Syntax : SYNTAX) = struct
1002
1002
(O. keyword " class" ++ O. txt " " ++ virtual_ ++ params ++ O. txt " " )
1003
1003
@ cname @ cd
1004
1004
in
1005
- let kind = Some " class" in
1005
+ let attr = [ " class" ] in
1006
1006
let anchor = path_to_id t.id in
1007
1007
let doc = Comment. first_to_ir t.doc in
1008
- Item. Declaration { kind ; anchor; doc; content }
1008
+ Item. Declaration { attr ; anchor; doc; content }
1009
1009
1010
1010
let class_type (t : Odoc_model.Lang.ClassType.t ) =
1011
1011
let name = Paths.Identifier. name t.id in
@@ -1034,10 +1034,10 @@ module Make (Syntax : SYNTAX) = struct
1034
1034
++ virtual_ ++ params ++ O. txt " " )
1035
1035
@ cname @ expr
1036
1036
in
1037
- let kind = Some " class-type" in
1037
+ let attr = [ " class-type" ] in
1038
1038
let anchor = path_to_id t.id in
1039
1039
let doc = Comment. first_to_ir t.doc in
1040
- Item. Declaration { kind ; anchor; doc; content }
1040
+ Item. Declaration { attr ; anchor; doc; content }
1041
1041
end
1042
1042
1043
1043
open Class
@@ -1166,10 +1166,10 @@ module Make (Syntax : SYNTAX) = struct
1166
1166
O. documentedSrc
1167
1167
(O. keyword " module" ++ O. txt " " ++ O. txt name ++ O. txt " := " ++ path)
1168
1168
in
1169
- let kind = Some " module-substitution" in
1169
+ let attr = [ " module-substitution" ] in
1170
1170
let anchor = path_to_id t.id in
1171
1171
let doc = Comment. to_ir t.doc in
1172
- Item. Declaration { kind ; anchor; doc; content }
1172
+ Item. Declaration { attr ; anchor; doc; content }
1173
1173
1174
1174
and simple_expansion :
1175
1175
Odoc_model.Lang.ModuleType. simple_expansion ->
@@ -1194,13 +1194,13 @@ module Make (Syntax : SYNTAX) = struct
1194
1194
let params =
1195
1195
Utils. flatmap params ~f: (fun arg ->
1196
1196
let content = functor_parameter arg in
1197
- let kind = Some " parameter" in
1197
+ let attr = [ " parameter" ] in
1198
1198
let anchor =
1199
1199
Utils. option_of_result
1200
1200
@@ Url.Anchor. from_identifier (arg.id :> Paths.Identifier.t )
1201
1201
in
1202
1202
let doc = [] in
1203
- [ Item. Declaration { content; anchor; kind ; doc } ])
1203
+ [ Item. Declaration { content; anchor; attr ; doc } ])
1204
1204
in
1205
1205
let prelude =
1206
1206
Item. Heading
@@ -1283,10 +1283,10 @@ module Make (Syntax : SYNTAX) = struct
1283
1283
@ O. documentedSrc
1284
1284
(if Syntax.Mod. close_tag_semicolon then O. txt " ;" else O. noop)
1285
1285
in
1286
- let kind = Some " module" in
1286
+ let attr = [ " module" ] in
1287
1287
let anchor = path_to_id t.id in
1288
1288
let doc = Comment. first_to_ir t.doc in
1289
- Item. Declaration { kind ; anchor; doc; content }
1289
+ Item. Declaration { attr ; anchor; doc; content }
1290
1290
1291
1291
and simple_expansion_in_decl (base : Paths.Identifier.Module.t ) se =
1292
1292
let rec ty_of_se :
@@ -1344,10 +1344,10 @@ module Make (Syntax : SYNTAX) = struct
1344
1344
@ O. documentedSrc
1345
1345
(if Syntax.Mod. close_tag_semicolon then O. txt " ;" else O. noop)
1346
1346
in
1347
- let kind = Some " module-type" in
1347
+ let attr = [ " module-type" ] in
1348
1348
let anchor = path_to_id t.id in
1349
1349
let doc = Comment. first_to_ir t.doc in
1350
- Item. Declaration { kind ; anchor; doc; content }
1350
+ Item. Declaration { attr ; anchor; doc; content }
1351
1351
1352
1352
and umty_hidden : Odoc_model.Lang.ModuleType.U.expr -> bool = function
1353
1353
| Path p -> Paths.Path. (is_hidden (p :> t ))
@@ -1528,10 +1528,10 @@ module Make (Syntax : SYNTAX) = struct
1528
1528
++ if Syntax.Mod. include_semicolon then O. keyword " ;" else O. noop )
1529
1529
in
1530
1530
let content = { Include. content; status; summary } in
1531
- let kind = Some " include" in
1531
+ let attr = [ " include" ] in
1532
1532
let anchor = None in
1533
1533
let doc = Comment. first_to_ir sg_doc in
1534
- Item. Include { kind ; anchor; doc; content }
1534
+ Item. Include { attr ; anchor; doc; content }
1535
1535
end
1536
1536
1537
1537
open Module
@@ -1556,9 +1556,9 @@ module Make (Syntax : SYNTAX) = struct
1556
1556
Utils. option_of_result
1557
1557
@@ Url.Anchor. from_identifier (id :> Paths.Identifier.t )
1558
1558
in
1559
- let kind = Some " modules" in
1559
+ let attr = [ " modules" ] in
1560
1560
let doc = [] in
1561
- let decl = { Item. anchor; content; kind ; doc } in
1561
+ let decl = { Item. anchor; content; attr ; doc } in
1562
1562
Item. Declaration decl
1563
1563
in
1564
1564
List. map f t
0 commit comments