Skip to content

Commit b97ed87

Browse files
panglesdjonludlam
authored andcommitted
Driver: improved interface for the Packages module
Signed-off-by: Paul-Elliot <[email protected]>
1 parent a551ba3 commit b97ed87

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

src/driver/packages.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ let pkg_dir top_dir pkg_name = maybe_prepend_top top_dir Fpath.(v pkg_name)
7272

7373
let parent_of_lib pkg_dir lib_name = Fpath.(pkg_dir / "lib" / lib_name)
7474

75-
let parent_of_pkg pkg_dir = Fpath.(pkg_dir / "doc")
75+
let parent_of_pages pkg_dir = Fpath.(pkg_dir / "doc")
7676

7777
let parent_of_src pkg_dir lib_name = Fpath.(pkg_dir / "src" / lib_name)
7878

@@ -336,7 +336,7 @@ let of_libs ~packages_dir libs =
336336
| None -> acc
337337
| Some rel_path ->
338338
let pkg_dir = pkg_dir packages_dir pkg_name in
339-
let id = Fpath.(parent_of_pkg pkg_dir // rel_path) in
339+
let id = Fpath.(parent_of_pages pkg_dir // rel_path) in
340340
let mld_parent_id = id |> Fpath.parent |> Fpath.rem_empty_seg in
341341
let page_name = Fpath.(rem_ext mld_path |> filename) in
342342
let odoc_file =
@@ -404,7 +404,7 @@ let of_libs ~packages_dir libs =
404404
mlds = update_mlds pkg.mlds libraries;
405405
}
406406
| None ->
407-
let mld_odoc_dir = parent_of_pkg pkg_dir in
407+
let mld_odoc_dir = parent_of_pages pkg_dir in
408408
Some
409409
{
410410
name = pkg.name;

src/driver/packages.mli

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ type libty = {
6767
modules : modulety list;
6868
}
6969

70-
val parent_of_pkg : Fpath.t -> Fpath.t
70+
val parent_of_pages : Fpath.t -> Fpath.t
71+
(** Given a [pkg_dir], returns a [mld_odoc_dir]. *)
7172

7273
module Lib : sig
7374
val v :

src/driver/voodoo.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ let process_package pkg =
7171
| None -> None
7272
| Some rel_path ->
7373
let id =
74-
Fpath.(Packages.parent_of_pkg (top_dir pkg) // rel_path)
74+
Fpath.(Packages.parent_of_pages (top_dir pkg) // rel_path)
7575
in
7676
let mld_parent_id =
7777
id |> Fpath.parent |> Fpath.rem_empty_seg
@@ -168,7 +168,7 @@ let process_package pkg =
168168
libdirs_without_meta
169169
in
170170
Printf.eprintf "Found %d metas" (List.length metas);
171-
let mld_odoc_dir = Packages.parent_of_pkg (top_dir pkg) in
171+
let mld_odoc_dir = Packages.parent_of_pages (top_dir pkg) in
172172
let libraries = List.flatten libraries in
173173
let libraries = List.flatten extra_libraries @ libraries in
174174
{

0 commit comments

Comments
 (0)