odoc: make indexes work with the development version of odoc

We now generate library titles at level 2 instead of level 1,
and remove trailing fullstop after the `modules` entry.

The development branch of odoc has a more precise parser that
enforces that there is only a single title level field in the
generated odoc.

Closes #791

Signed-off-by: Anil Madhavapeddy <anil@recoil.org>
This commit is contained in:
Anil Madhavapeddy 2018-05-23 09:10:55 +01:00
parent 34ec6e050d
commit b2dd904847
2 changed files with 6 additions and 6 deletions

View File

@ -411,7 +411,7 @@ module Gen (S : sig val sctx : SC.t end) = struct
|> List.sort ~compare:(fun (x, _) (y, _) ->
String.compare (Lib.name x) (Lib.name y))
|> List.iter ~f:(fun (lib, modules) ->
Printf.bprintf b "{1 Library %s}\n" (Lib.name lib);
Printf.bprintf b "{2 Library %s}\n" (Lib.name lib);
Buffer.add_string b (
match modules with
| [ x ] ->
@ -421,7 +421,7 @@ module Gen (S : sig val sctx : SC.t end) = struct
| _ ->
sprintf
"This library exposes the following toplevel modules:\n\
{!modules:%s}.\n"
{!modules:%s}\n"
(modules
|> List.sort ~compare:(fun x y ->
Module.Name.compare (Module.name x) (Module.name y))

View File

@ -41,14 +41,14 @@
</html>
$ dune build @foo-mld --display short
{1 Library foo}
{2 Library foo}
This library exposes the following toplevel modules:
{!modules:Foo Foo2}.
{1 Library foo.byte}
{!modules:Foo Foo2}
{2 Library foo.byte}
The entry point of this library is the module:
{!module-Foo_byte}.
$ dune build @bar-mld --display short
{1 Library bar}
{2 Library bar}
The entry point of this library is the module:
{!module-Bar}.