Merge pull request #671 from rgrinberg/pr/653
Cosmetic changes for default package entry point.
This commit is contained in:
commit
62bbd5d30e
|
@ -1013,7 +1013,9 @@ module Gen(P : Install_rules.Params) = struct
|
||||||
Odoc.init ~modules_by_lib:(fun ~dir lib ->
|
Odoc.init ~modules_by_lib:(fun ~dir lib ->
|
||||||
let m = modules_by_lib ~dir lib in
|
let m = modules_by_lib ~dir lib in
|
||||||
match m.alias_module with
|
match m.alias_module with
|
||||||
| Some m -> [m]
|
| Some alias_mod ->
|
||||||
|
[Option.value ~default:alias_mod
|
||||||
|
(Module.Name.Map.find m.modules m.main_module_name)]
|
||||||
| None -> Module.Name.Map.values m.modules
|
| None -> Module.Name.Map.values m.modules
|
||||||
) ~mlds_of_dir
|
) ~mlds_of_dir
|
||||||
end
|
end
|
||||||
|
|
27
src/odoc.ml
27
src/odoc.ml
|
@ -409,18 +409,23 @@ module Gen (S : sig val sctx : SC.t end) = struct
|
||||||
|> List.sort ~compare:(fun (x, _) (y, _) ->
|
|> List.sort ~compare:(fun (x, _) (y, _) ->
|
||||||
String.compare (Lib.name x) (Lib.name y))
|
String.compare (Lib.name x) (Lib.name y))
|
||||||
|> List.iter ~f:(fun (lib, modules) ->
|
|> List.iter ~f:(fun (lib, modules) ->
|
||||||
|
Printf.bprintf b "{1 Library %s}\n" (Lib.name lib);
|
||||||
Buffer.add_string b (
|
Buffer.add_string b (
|
||||||
sprintf
|
match modules with
|
||||||
"{1 Library %s}\n\
|
| [ x ] ->
|
||||||
This library exposes the following toplevel modules:\n\
|
sprintf
|
||||||
{!modules:%s}\n"
|
"The entry point of this library is the module:\n{!module-%s}.\n"
|
||||||
(Lib.name lib)
|
(Module.Name.to_string (Module.name x))
|
||||||
(modules
|
| _ ->
|
||||||
|> List.sort ~compare:(fun x y ->
|
sprintf
|
||||||
Module.Name.compare (Module.name x) (Module.name y))
|
"This library exposes the following toplevel modules:\n\
|
||||||
|> List.map ~f:(fun m -> Module.Name.to_string (Module.name m))
|
{!modules:%s}.\n"
|
||||||
|> String.concat ~sep:" ")
|
(modules
|
||||||
)
|
|> List.sort ~compare:(fun x y ->
|
||||||
|
Module.Name.compare (Module.name x) (Module.name y))
|
||||||
|
|> List.map ~f:(fun m -> Module.Name.to_string (Module.name m))
|
||||||
|
|> String.concat ~sep:" ")
|
||||||
|
);
|
||||||
);
|
);
|
||||||
Buffer.contents b
|
Buffer.contents b
|
||||||
|
|
||||||
|
|
|
@ -43,12 +43,12 @@
|
||||||
$ jbuilder build @foo-mld --display short
|
$ jbuilder build @foo-mld --display short
|
||||||
{1 Library foo}
|
{1 Library foo}
|
||||||
This library exposes the following toplevel modules:
|
This library exposes the following toplevel modules:
|
||||||
{!modules:Foo Foo2}
|
{!modules:Foo Foo2}.
|
||||||
{1 Library foo.byte}
|
{1 Library foo.byte}
|
||||||
This library exposes the following toplevel modules:
|
The entry point of this library is the module:
|
||||||
{!modules:Foo_byte}
|
{!module-Foo_byte}.
|
||||||
|
|
||||||
$ jbuilder build @bar-mld --display short
|
$ jbuilder build @bar-mld --display short
|
||||||
{1 Library bar}
|
{1 Library bar}
|
||||||
This library exposes the following toplevel modules:
|
The entry point of this library is the module:
|
||||||
{!modules:Bar}
|
{!module-Bar}.
|
||||||
|
|
Loading…
Reference in New Issue