@@ -784,7 +784,21 @@ let odoc_artefacts sctx target =
784784 | Lib lib ->
785785 let info = Lib.Local. info lib in
786786 let obj_dir = Lib_info. obj_dir info in
787- let + modules = entry_modules_by_lib sctx lib in
787+ let + modules =
788+ let + modules = Dir_contents. modules_of_local_lib sctx lib in
789+ Modules. fold modules ~init: [] ~f: (fun m acc ->
790+ (* Only include modules that:
791+ 1. Have public visibility
792+ 2. Are not wrapped library implementation modules (those with __ in the name) *)
793+ if Module. visibility m = Public
794+ && (Module. obj_name m
795+ |> Module_name.Unique. to_name ~loc: Loc. none
796+ |> Module_name. to_string
797+ |> String. contains_double_underscore
798+ |> not )
799+ then m :: acc
800+ else acc)
801+ in
788802 List. map modules ~f: (fun m ->
789803 let odoc_file = Obj_dir.Module. odoc obj_dir m in
790804 create_odoc ctx ~target odoc_file)
@@ -1116,24 +1130,10 @@ let setup_package_odoc_rules sctx ~pkg =
11161130;;
11171131
11181132let gen_project_rules sctx project =
1119- let () =
1120- User_message. print
1121- (User_message. make
1122- [ Pp. textf " Odoc.gen_project_rules called for project: %s"
1123- (Dune_project. name project |> Dune_project_name. to_string_hum)
1124- ])
1125- in
11261133 Dune_project. packages project
11271134 |> Dune_lang.Package_name.Map. to_seq
11281135 |> Memo. parallel_iter_seq ~f: (fun (_ , (pkg : Package.t )) ->
11291136 (* setup @doc to build the correct html for the package *)
1130- let () =
1131- User_message. print
1132- (User_message. make
1133- [ Pp. textf " Setting up package aliases for: %s"
1134- (Package. name pkg |> Package.Name. to_string)
1135- ])
1136- in
11371137 setup_package_aliases sctx pkg)
11381138;;
11391139
0 commit comments