···530530 field fld.mutable_ (fld.id :> Paths.Identifier.t) fld.type_
531531 in
532532 let anchor = Some url in
533533- let rhs = Comment.to_ir fld.doc in
534534- let doc =
535535- if not (Comment.has_doc fld.doc.elements) then [] else rhs
536536- in
533533+ let doc = fld.doc.elements in
534534+ let rhs = Comment.to_ir doc in
535535+ let doc = if not (Comment.has_doc doc) then [] else rhs in
537536 let markers = Syntax.Comment.markers in
538537 DocumentedSrc.Documented { anchor; attrs; code; doc; markers })
539538 in
···610609 cstr.args cstr.res
611610 in
612611 let anchor = Some url in
613613- let rhs = Comment.to_ir cstr.doc in
614614- let doc =
615615- if not (Comment.has_doc cstr.doc.elements) then [] else rhs
616616- in
612612+ let doc = cstr.doc.elements in
613613+ let rhs = Comment.to_ir doc in
614614+ let doc = if not (Comment.has_doc doc) then [] else rhs in
617615 let markers = Syntax.Comment.markers in
618616 DocumentedSrc.Nested { anchor; attrs; code; doc; markers })
619617 in
···625623 let anchor = Some url in
626624 let attrs = [ "def"; "variant"; Url.Anchor.string_of_kind url.kind ] in
627625 let code = O.documentedSrc (O.txt "| ") @ constructor id t.args t.res in
628628- let doc = Comment.to_ir t.doc in
626626+ let doc = Comment.to_ir t.doc.elements in
629627 let markers = Syntax.Comment.markers in
630628 DocumentedSrc.Nested { anchor; attrs; code; doc; markers }
631629···646644 in
647645 let attr = [ "type"; "extension" ] in
648646 let anchor = Some (Url.Anchor.extension_decl t) in
649649- let doc = Comment.to_ir t.doc in
647647+ let doc = Comment.to_ir t.doc.elements in
650648 let source_anchor =
651649 (* Take the anchor from the first constructor only for consistency with
652650 regular variants. *)
···666664 in
667665 let attr = [ "exception" ] in
668666 let anchor = path_to_id t.id in
669669- let doc = Comment.to_ir t.doc in
667667+ let doc = Comment.to_ir t.doc.elements in
670668 let source_anchor = source_anchor t.source_loc in
671669 Item.Declaration { attr; anchor; doc; content; source_anchor }
672670···710708 else O.txt " " ++ O.keyword "of" ++ O.sp ++ params)),
711709 match doc with
712710 | { elements = []; _ } -> None
713713- | _ -> Some (Comment.to_ir doc) ))
711711+ | _ -> Some (Comment.to_ir doc.elements) ))
714712 in
715713 let markers = Syntax.Comment.markers in
716714 try
···881879 in
882880 let attr = "type" :: (if is_substitution then [ "subst" ] else []) in
883881 let anchor = path_to_id t.id in
884884- let doc = Comment.to_ir t.doc in
882882+ let doc = Comment.to_ir t.doc.elements in
885883 let source_anchor = source_anchor t.source_loc in
886884 Item.Declaration { attr; anchor; doc; content; source_anchor }
887885 end
···909907 in
910908 let attr = [ "value" ] @ extra_attr in
911909 let anchor = path_to_id t.id in
912912- let doc = Comment.to_ir t.doc in
910910+ let doc = Comment.to_ir t.doc.elements in
913911 let source_anchor = source_anchor t.source_loc in
914912 Item.Declaration { attr; anchor; doc; content; source_anchor }
915913 end
···10101008 in
10111009 let attr = [ "method" ] in
10121010 let anchor = path_to_id t.id in
10131013- let doc = Comment.to_ir t.doc in
10111011+ let doc = Comment.to_ir t.doc.elements in
10141012 Item.Declaration { attr; anchor; doc; content; source_anchor = None }
1015101310161014 let instance_variable (t : Odoc_model.Lang.InstanceVariable.t) =
···10291027 in
10301028 let attr = [ "value"; "instance-variable" ] in
10311029 let anchor = path_to_id t.id in
10321032- let doc = Comment.to_ir t.doc in
10301030+ let doc = Comment.to_ir t.doc.elements in
10331031 Item.Declaration { attr; anchor; doc; content; source_anchor = None }
1034103210351033 let inherit_ (ih : Lang.ClassSignature.Inherit.t) =
···10431041 in
10441042 let attr = [ "inherit" ] in
10451043 let anchor = None in
10461046- let doc = Comment.to_ir ih.doc in
10441044+ let doc = Comment.to_ir ih.doc.elements in
10471045 Item.Declaration { attr; anchor; doc; content; source_anchor = None }
1048104610491047 let constraint_ (cst : Lang.ClassSignature.Constraint.t) =
···10521050 in
10531051 let attr = [] in
10541052 let anchor = None in
10551055- let doc = Comment.to_ir cst.doc in
10531053+ let doc = Comment.to_ir cst.doc.elements in
10561054 Item.Declaration { attr; anchor; doc; content; source_anchor = None }
1057105510581056 let class_signature (c : Lang.ClassSignature.t) =
···13141312 in
13151313 let attr = [ "module-substitution" ] in
13161314 let anchor = path_to_id t.id in
13171317- let doc = Comment.to_ir t.doc in
13151315+ let doc = Comment.to_ir t.doc.elements in
13181316 Item.Declaration { attr; anchor; doc; content; source_anchor = None }
1319131713201318 and module_type_substitution (t : Odoc_model.Lang.ModuleTypeSubstitution.t)
···17241722 synopsis because no page is generated to render it and we'd loose
17251723 the full documentation.
17261724 The documentation from the expansion is not used. *)
17271727- Comment.to_ir t.doc
17251725+ Comment.to_ir t.doc.elements
17281726 in
17291727 Item.Include { attr; anchor; doc; content; source_anchor = None }
17301728 end
+1-1
src/document/sidebar.ml
···9494 | Page { short_title = None; _ } ->
9595 let title =
9696 let open Odoc_model in
9797- match Comment.find_zero_heading entry.doc.elements with
9797+ match Comment.find_zero_heading entry.doc with
9898 | Some t -> t
9999 | None ->
100100 let name =
···66type t = Entry.t Tree.t
7788module Entry = struct
99+ open Odoc_model.Comment
1010+911 let of_comp_unit (u : Compilation_unit.t) =
1012 let has_expansion = true in
1113 let doc =
1212- match u.content with
1313- | Pack _ ->
1414- { Odoc_model.Comment.elements = []; suppress_warnings = false }
1515- | Module m -> m.doc
1414+ match u.content with Pack _ -> [] | Module m -> m.doc.elements
1615 in
1716 Entry.entry ~id:u.id ~doc ~kind:(Module { has_expansion })
1817···2019 let has_expansion =
2120 match m.type_ with Alias (_, None) -> false | _ -> true
2221 in
2323- Entry.entry ~id:m.id ~doc:m.doc ~kind:(Module { has_expansion })
2222+ Entry.entry ~id:m.id ~doc:m.doc.elements ~kind:(Module { has_expansion })
24232524 let of_module_type (mt : ModuleType.t) =
2625 let has_expansion =
···3534 | _ -> false)
3635 | _ -> true
3736 in
3838- Entry.entry ~id:mt.id ~doc:mt.doc ~kind:(ModuleType { has_expansion })
3737+ Entry.entry ~id:mt.id ~doc:mt.doc.elements
3838+ ~kind:(ModuleType { has_expansion })
39394040 let of_type_decl (td : TypeDecl.t) =
4141 let kind =
···4646 representation = td.representation;
4747 }
4848 in
4949- Entry.entry ~id:td.id ~doc:td.doc ~kind
4949+ Entry.entry ~id:td.id ~doc:td.doc.elements ~kind
50505151 let varify_params =
5252 List.mapi (fun i param ->
···6767 params )
6868 in
6969 let kind = Entry.Constructor { args; res } in
7070- Entry.entry ~id:c.id ~doc:c.doc ~kind
7070+ Entry.entry ~id:c.id ~doc:c.doc.elements ~kind
71717272 let of_field id_parent params (field : TypeDecl.Field.t) =
7373 let params = varify_params params in
···8181 Entry.Field
8282 { mutable_ = field.mutable_; type_ = field.type_; parent_type }
8383 in
8484- Entry.entry ~id:field.id ~doc:field.doc ~kind
8484+ Entry.entry ~id:field.id ~doc:field.doc.elements ~kind
85858686 let of_exception (exc : Exception.t) =
8787 let res =
···9393 | Some x -> x
9494 in
9595 let kind = Entry.Exception { args = exc.args; res } in
9696- Entry.entry ~id:exc.id ~doc:exc.doc ~kind
9696+ Entry.entry ~id:exc.id ~doc:exc.doc.elements ~kind
97979898 let of_value (v : Value.t) =
9999 let kind = Entry.Value { value = v.value; type_ = v.type_ } in
100100- Entry.entry ~id:v.id ~doc:v.doc ~kind
100100+ Entry.entry ~id:v.id ~doc:v.doc.elements ~kind
101101102102 let of_extension_constructor type_path params (v : Extension.Constructor.t) =
103103 let res =
···108108 TypeExpr.Constr (type_path, params)
109109 in
110110 let kind = Entry.ExtensionConstructor { args = v.args; res } in
111111- Entry.entry ~id:v.id ~doc:v.doc ~kind
111111+ Entry.entry ~id:v.id ~doc:v.doc.elements ~kind
112112113113 let of_class (cl : Class.t) =
114114 let kind = Entry.Class { virtual_ = cl.virtual_; params = cl.params } in
115115- Entry.entry ~id:cl.id ~doc:cl.doc ~kind
115115+ Entry.entry ~id:cl.id ~doc:cl.doc.elements ~kind
116116117117 let of_class_type (ct : ClassType.t) =
118118 let kind =
119119 Entry.Class_type { virtual_ = ct.virtual_; params = ct.params }
120120 in
121121- Entry.entry ~id:ct.id ~doc:ct.doc ~kind
121121+ Entry.entry ~id:ct.id ~doc:ct.doc.elements ~kind
122122123123 let of_method (m : Method.t) =
124124 let kind =
125125 Entry.Method
126126 { virtual_ = m.virtual_; private_ = m.private_; type_ = m.type_ }
127127 in
128128- Entry.entry ~id:m.id ~doc:m.doc ~kind
128128+ Entry.entry ~id:m.id ~doc:m.doc.elements ~kind
129129130130- let of_docs id doc = Entry.entry ~id ~doc ~kind:Doc
130130+ let of_docs id doc = Entry.entry ~id ~doc:doc.elements ~kind:Doc
131131end
132132133133let if_non_hidden id f =
+4-9
src/index/skeleton_of.ml
···3939 try_ Astring.String.compare by_name @@ fun () -> 0
40404141let rec t_of_in_progress (dir : In_progress.in_progress) : t =
4242- let empty_doc = { Comment.elements = []; suppress_warnings = false } in
4343-4442 let entry_of_page page =
4543 let kind = Entry.Page page.Lang.Page.frontmatter in
4646- let doc = page.content in
4444+ let doc = page.content.elements in
4745 let id = page.name in
4846 Entry.entry ~kind ~doc ~id
4947 in
5048 let entry_of_impl id =
5149 let kind = Entry.Impl in
5252- let doc = empty_doc in
5353- Entry.entry ~kind ~doc ~id
5050+ Entry.entry ~kind ~doc:[] ~id
5451 in
5552 let children_order, index =
5653 match In_progress.index dir with
···6360 match In_progress.root_dir dir with
6461 | Some id ->
6562 let kind = Entry.Dir in
6666- let doc = empty_doc in
6767- Entry.entry ~kind ~doc ~id
6363+ Entry.entry ~kind ~doc:[] ~id
6864 | None ->
6965 let id =
7066 (* root dir must have an index page *)
7167 Id.Mk.leaf_page (None, Names.PageName.make_std "index")
7268 in
7369 let kind = Entry.Dir in
7474- let doc = empty_doc in
7575- Entry.entry ~kind ~doc ~id
7070+ Entry.entry ~kind ~doc:[] ~id
7671 in
7772 (None, entry)
7873 in
+1-1
src/odoc/html_fragment.ml
···3434 Odoc_xref2.Link.resolve_page ~filename:input_s env page
3535 |> Odoc_model.Error.handle_warnings ~warnings_options
3636 >>= fun resolved ->
3737- let page = Odoc_document.Comment.to_ir resolved.content in
3737+ let page = Odoc_document.Comment.to_ir resolved.content.elements in
3838 let config =
3939 Odoc_html.Config.v ~semantic_uris:false ~indent:false ~flat:false
4040 ~open_details:false ~as_json:false ~remap:[] ()
+2-2
src/search/html.mli
···2727 The tuple is intended to be given respectively to the [prefix_name] and
2828 [name] arguments of {!Odoc_html_frontend.of_strings}. *)
29293030-val of_doc : Comment.docs -> html
3030+val of_doc : Comment.elements -> html
3131(** [of_doc d] returns the HTML associated of the documentation comment [d],
3232 generated correctly for search (no links or anchors). *)
33333434-val html_string_of_doc : Comment.docs -> string
3434+val html_string_of_doc : Comment.elements -> string
3535(** [html_string_of_doc d] is the same as {!of_doc} converted to a
3636 string. *)
3737