Skip to content

Commit 022058e

Browse files
committed
Driver: don't include source dir if no implementation are rendered
1 parent 2836156 commit 022058e

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/driver/odoc_units_of.ml

+12-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,18 @@ let packages ~dirs ~extra_paths ~remap (pkgs : Packages.t list) : t list =
270270
[ Landing_pages.package ~dirs ~pkg ~index ]
271271
in
272272
let src_index :> t list =
273-
if List.length pkg.libraries > 0 then
273+
if
274+
(* Some library has a module which has an implementation which has a source *)
275+
List.exists
276+
(fun lib ->
277+
List.exists
278+
(fun m ->
279+
match m.Packages.m_impl with
280+
| Some { mip_src_info = Some _; _ } -> true
281+
| _ -> false)
282+
lib.Packages.modules)
283+
pkg.libraries
284+
then
274285
let index = index_of pkg in
275286
[ Landing_pages.src ~dirs ~pkg ~index ]
276287
else []

0 commit comments

Comments
 (0)