Cosmetic changes for default package entry point.
This commit is contained in:
parent
244773ef80
commit
77c717b9af
|
@ -1018,7 +1018,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
|
@ -408,18 +408,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 -j1 --display short --root .
|
$ $JBUILDER build @foo-mld -j1 --display short --root .
|
||||||
{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 -j1 --display short --root .
|
$ $JBUILDER build @bar-mld -j1 --display short --root .
|
||||||
{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