Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc-new: Omit docs for 'empty libraries' #10319

Merged
merged 2 commits into from
Mar 29, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 18 additions & 15 deletions src/dune_rules/odoc_new.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1619,21 +1619,24 @@ let standard_index_contents b entry_modules =
entry_modules
|> List.sort ~compare:(fun (x, _) (y, _) -> Lib_name.compare x y)
|> List.iter ~f:(fun (lib, modules) ->
Printf.bprintf b "{1 Library %s}\n" (Lib_name.to_string lib);
Buffer.add_string
b
(match modules with
| [ x ] ->
sprintf
"The entry point of this library is the module:\n{!%s}.\n"
(Artifact.reference x)
| _ ->
sprintf
"This library exposes the following toplevel modules:\n{!modules:%s}\n"
(modules
|> List.map ~f:Artifact.name
|> List.sort ~compare:String.compare
|> String.concat ~sep:" ")))
match modules with
| [] -> () (* No library here! *)
| _ ->
Printf.bprintf b "{1 Library %s}\n" (Lib_name.to_string lib);
Buffer.add_string
b
(match modules with
| [ x ] ->
sprintf
"The entry point of this library is the module:\n{!%s}.\n"
(Artifact.reference x)
| _ ->
sprintf
"This library exposes the following toplevel modules:\n{!modules:%s}\n"
(modules
|> List.map ~f:Artifact.name
|> List.sort ~compare:String.compare
|> String.concat ~sep:" ")))
;;

let fallback_index_contents b entry_modules artifacts =
Expand Down
Loading