123456789101112131415161718192021222324252627282930313233343536373839404142434445464748openOr_errorletfrom_mld~xref_base_uri~resolver~output~warnings_optionsinput=(* Internal names, they don't have effect on the output. *)letpage_name="__fragment_page__"inletid=Odoc_model.Paths.Identifier.Mk.page(None,Odoc_model.Names.PageName.make_stdpage_name)inletinput_s=Fs.File.to_stringinputinletdigest=Digest.fileinput_sinletroot=letfile=Odoc_model.Root.Odoc_file.create_pagepage_namein{Odoc_model.Root.id;file;digest}inletto_htmlcontent=(* This is a mess. *)letpage=Odoc_model.Lang.Page.{name=id;root;content;children=[];digest;linked=false}inletenv=Resolver.build_env_for_pageresolverpageinOdoc_xref2.Link.resolve_page~filename:input_senvpage|>Odoc_model.Error.handle_warnings~warnings_options>>=funresolved->letpage=Odoc_document.Comment.to_irresolved.contentinletconfig=Odoc_html.Config.v~semantic_uris:false~indent:false~flat:false~open_details:false~as_json:false()inlethtml=Odoc_html.Generator.doc~config~xref_base_uripageinletoc=open_out(Fs.File.to_stringoutput)inletfmt=Format.formatter_of_out_channelocinFormat.fprintffmt"%a@."(Format.pp_print_list(Tyxml.Html.pp_elt()))html;close_outoc;Ok()inmatchFs.File.readinputwith|Error_ase->e|Okstr->(Odoc_loader.read_stringidinput_sstr|>Odoc_model.Error.handle_errors_and_warnings~warnings_options>>=function|`Docscontent->to_htmlcontent|`Stop->to_html[])(* TODO: Error? *)