(* Page shell interface for pluggable HTML page assembly. A shell controls the overall page structure: the
contents, the layout, and how pre-rendered HTML fragments are arranged into a complete page. *) module Html := Tyxml.Html (** Data for assembling a documentation page. All HTML fragments are pre-rendered by the generator. *) type page_data = { url : Odoc_document.Url.Path.t; header : Html_types.flow5_without_header_footer Html.elt list; preamble : Html_types.flow5_without_header_footer Html.elt list; content : Html_types.div_content Html.elt list; breadcrumbs : Types.breadcrumbs; toc : Types.toc list; sidebar : Html_types.div_content Html.elt list option; sidebar_data : Odoc_document.Sidebar.t option; uses_katex : bool; source_anchor : string option; resources : Odoc_extension_registry.resource list; assets : Odoc_extension_registry.asset list; children : Odoc_document.Renderer.page list; } (** Data for assembling a source code page. *) type src_page_data = { url : Odoc_document.Url.Path.t; header : Html_types.flow5_without_header_footer Html.elt list; breadcrumbs : Types.breadcrumbs; sidebar : Html_types.div_content Html.elt list option; sidebar_data : Odoc_document.Sidebar.t option; title : string; content : Html_types.div_content Html.elt list; } (** The interface that a page shell must implement. *) module type S = sig val name : string (** Short identifier for CLI selection, e.g. "default" or "json". *) val make : config:Config.t -> page_data -> Odoc_document.Renderer.page (** Assemble a documentation page from pre-rendered fragments. *) val make_src : config:Config.t -> src_page_data -> Odoc_document.Renderer.page (** Assemble a source code page from pre-rendered fragments. *) end (** {1 Shell Registry} *) val register : (module S) -> unit (** Register a shell. Shells are identified by name. *) val find : string -> (module S) option (** Look up a shell by name. *) val list_shells : unit -> string list (** List all registered shell names. *) val default : unit -> (module S) (** Return the default shell ("default"). Raises if no default is registered. *)