Skip to content

Commit 01ea486

Browse files
committed
Document Odoc.Dep
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
1 parent f59a254 commit 01ea486

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

src/dune_rules/odoc.ml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,24 @@ module Paths = struct
9393
let toplevel_index ctx = html_root ctx ++ "index.html"
9494
end
9595

96-
module Dep = struct
96+
module Dep : sig
97+
(** [html_alias ctx target] returns the alias that depends on all html targets
98+
produced by odoc for [target] *)
99+
val html_alias : Context.t -> target -> Alias.t
100+
101+
(** [deps ctx pkg libraries] returns all odoc dependencies of [libraries. If
102+
[libraries] are all part of a package [pkg], then the odoc dependencies of
103+
the package are also returned*)
104+
val deps :
105+
Context.t
106+
-> Package.Name.t option
107+
-> (Lib.t list, exn) result
108+
-> unit Build.t
109+
110+
(*** [setup_deps ctx target odocs] Adds [odocs] as dependencies for [target].
111+
These dependencies may be used using the [deps] function *)
112+
val setup_deps : Context.t -> target -> Path.Set.t -> unit
113+
end = struct
97114
let html_alias ctx m = Alias.doc ~dir:(Paths.html ctx m)
98115

99116
let alias = Alias.make (Alias.Name.of_string ".odoc-all")
@@ -118,8 +135,6 @@ module Dep = struct
118135

119136
let alias ctx m = alias ~dir:(Paths.odocs ctx m)
120137

121-
(* let static_deps t lib = Build_system.Alias.dep (alias t lib) *)
122-
123138
let setup_deps ctx m files = Rules.Produce.Alias.add_deps (alias ctx m) files
124139
end
125140

0 commit comments

Comments
 (0)