123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167openOdoc_utilsmodulePath=Paths.PathmoduleReference=Paths.ReferencemoduleIdentifier=Paths.Identifiertype'awith_location='aLocation_.with_locationtypestyle=[`Bold|`Italic|`Emphasis|`Superscript|`Subscript]typealignment=[`Left|`Center|`Right]typemedia=[`Image|`Audio|`Video]typeraw_markup_target=stringtypeleaf_inline_element=[`Space|`Wordofstring|`Code_spanofstring|`Math_spanofstring|`Raw_markupofraw_markup_target*string]typenon_link_inline_element=[leaf_inline_element|`Styledofstyle*non_link_inline_elementwith_locationlist](* The cross-referencer stores section heading text, and sometimes pastes it
into link contents. This type alias is provided for use by the
cross-referencer. *)typelink_content=non_link_inline_elementwith_locationlisttypereference_element=[`ReferenceofReference.t*link_content]typeinline_element=[leaf_inline_element|`Styledofstyle*inline_elementwith_locationlist|reference_element|`Linkofstring*link_content]typeparagraph=inline_elementwith_locationlisttypemodule_reference={module_reference:Reference.Module.t;module_synopsis:paragraphoption;}(** The [{!modules: ...}] markup. [module_synopsis] is initially [None], it is
resolved during linking. *)type'acell='awith_locationlist*[`Header|`Data]type'arow='acelllisttype'agrid='arowlisttype'aabstract_table={data:'agrid;align:alignmentoptionlistoption;}typemedia_href=[`Linkofstring|`ReferenceofReference.Asset.t]typemedia_element=[`Mediaofmedia_href*media*string]typenestable_block_element=[`Paragraphofparagraph|`Code_blockofstringoption*stringwith_location*Odoc_parser.Ast.code_block_tags*nestable_block_elementwith_locationlistoption|`Math_blockofstring|`Verbatimofstring|`Modulesofmodule_referencelist|`Tableofnestable_block_elementabstract_table|`Listof[`Unordered|`Ordered]*nestable_block_elementwith_locationlistlist|media_element]typetag=[`Authorofstring|`Deprecatedofnestable_block_elementwith_locationlist|`Paramofstring*nestable_block_elementwith_locationlist|`Raiseof[`Code_spanofstring|reference_element]*nestable_block_elementwith_locationlist|`Returnofnestable_block_elementwith_locationlist|`Seeof[`Url|`File|`Document]*string*nestable_block_elementwith_locationlist|`Sinceofstring|`Beforeofstring*nestable_block_elementwith_locationlist|`Versionofstring|`Alertofstring*stringoption]typeheading_level=[`Title|`Section|`Subsection|`Subsubsection|`Paragraph|`Subparagraph]typeattached_block_element=[nestable_block_element|`Tagoftag]typeheading_attrs={heading_level:heading_level;heading_label_explicit:bool;(** Whether the label have been written by the user. *)}typeblock_element=[nestable_block_element|`Headingofheading_attrs*Identifier.Label.t*inline_elementwith_locationlist|`Tagoftag]typeelements=block_elementwith_locationlisttypedocs={elements:elements;warnings_tag:stringoption}typedocs_or_stop=[`Docsofdocs|`Stop](** The synopsis is the first element of a comment if it is a paragraph.
Otherwise, there is no synopsis. *)letsynopsis=function|{Location_.value=`Paragraphp;_}::_->Somep|_->Noneletreclink_content_of_inline_element:inline_elementwith_location->link_content=funx->letv=x.Location_.valueinmatchvwith|#leaf_inline_elementase->[{xwithvalue=e}]|`Reference(_,r)->r|`Link(_,l)->l|`Styled(st,elems)->[{xwithvalue=`Styled(st,link_content_of_inline_elementselems)}]andlink_content_of_inline_elementsl=l|>List.maplink_content_of_inline_element|>List.concatletfind_zero_headingdocs:link_contentoption=List.find_map(fundoc->matchdoc.Location_.valuewith|`Heading({heading_level=`Title;_},_,h_content)->Some(link_content_of_inline_elementsh_content)|_->None)docs(* Used in particular to sort the title names *)letto_string(l:link_content)=letrecs_of_i(i:non_link_inline_element)=matchiwith|`Code_spans->s|`Wordw->w|`Math_spanm->m|`Space->" "|`Styled(_,is)->s_of_isis|`Raw_markup(_,r)->rands_of_isis=is|>List.map(fun{Location_.value;_}->s_of_ivalue)|>String.concat~sep:""ins_of_isl