this repo has no description
at main 95 lines 2.9 kB view raw
1module Pkg_args : sig 2 type t 3 4 val compiled_pages : t -> (string * Fpath.t) list 5 val compiled_libs : t -> (string * Fpath.t) list 6 val includes : t -> Fpath.t list 7 val linked_pages : t -> (string * Fpath.t) list 8 val linked_libs : t -> (string * Fpath.t) list 9 10 val v : 11 odoc_dir:Fpath.t -> 12 odocl_dir:Fpath.t -> 13 includes:Fpath.t list -> 14 pages:(string * Fpath.t) list -> 15 libs:(string * Fpath.t) list -> 16 t 17 18 val combine : t -> t -> t 19 20 val pp : t Fmt.t 21end 22 23type sidebar = { output_file : Fpath.t; json : bool; pkg_dir : Fpath.t } 24type index = { 25 roots : Fpath.t list; 26 output_file : Fpath.t; 27 json : bool; 28 search_dir : Fpath.t; 29 sidebar : sidebar option; 30} 31 32type 'a t = { 33 parent_id : Odoc.Id.t; 34 input_file : Fpath.t; 35 input_copy : Fpath.t option; 36 (* Used to stash cmtis from virtual libraries into the odoc dir for voodoo mode *) 37 output_dir : Fpath.t; 38 odoc_file : Fpath.t; 39 odocl_file : Fpath.t; 40 pkg_args : Pkg_args.t; 41 pkgname : string option; 42 index : index option; 43 enable_warnings : bool; 44 to_output : bool; 45 kind : 'a; 46} 47 48type intf_extra = { 49 hidden : bool; 50 hash : string; 51 deps : (string * Digest.t) list; 52} 53and intf = [ `Intf of intf_extra ] 54 55type impl_extra = { src_id : Odoc.Id.t; src_path : Fpath.t } 56type impl = [ `Impl of impl_extra ] 57 58type mld = [ `Mld ] 59type md = [ `Md ] 60type asset = [ `Asset ] 61 62type any = [ impl | intf | mld | asset | md ] t 63 64val pp : any Fmt.t 65 66val pkg_dir : Packages.t -> Fpath.t 67val lib_dir : Packages.t -> Packages.libty -> Fpath.t 68val doc_dir : Packages.t -> Fpath.t 69val src_dir : Packages.t -> Fpath.t 70val src_lib_dir : Packages.t -> Packages.libty -> Fpath.t 71 72type dirs = { 73 odoc_dir : Fpath.t; 74 odocl_dir : Fpath.t; 75 index_dir : Fpath.t; 76 mld_dir : Fpath.t; 77} 78 79val fix_virtual : 80 precompiled_units:intf t list Util.StringMap.t -> 81 units:intf t list Util.StringMap.t -> 82 intf t list Util.StringMap.t 83(** [fix_virtual ~precompiled_units ~units] replaces the input file in units 84 representing implementations of virtual libraries. Implementation units have 85 a [cmt] but no [cmti], even though the interface is actually constrained by 86 a [mli]. The [cmi] file for the implementation is actually taken from the 87 virtual library, so this function replaces the [cmt] used for the interface 88 rendering of the implemenetation library units with the [cmti] taken from 89 the virtual library. [units] should contain all the units that might be 90 changed by this function. [precompiled_units] should be empty if this is 91 being called before any compilation has taken place - ie. in monorepo or 92 opam mode. In voodoo mode if the virtual library is in a different package 93 it will have already been compiled. and thus should not be changed. The 94 types of the inputs and outputs are hashtbls of units, where the hashtable 95 key is the interface hash. *)