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:
parent
34ec6e050d
commit
b2dd904847
|
@ -411,7 +411,7 @@ 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);
|
Printf.bprintf b "{2 Library %s}\n" (Lib.name lib);
|
||||||
Buffer.add_string b (
|
Buffer.add_string b (
|
||||||
match modules with
|
match modules with
|
||||||
| [ x ] ->
|
| [ x ] ->
|
||||||
|
@ -421,7 +421,7 @@ module Gen (S : sig val sctx : SC.t end) = struct
|
||||||
| _ ->
|
| _ ->
|
||||||
sprintf
|
sprintf
|
||||||
"This library exposes the following toplevel modules:\n\
|
"This library exposes the following toplevel modules:\n\
|
||||||
{!modules:%s}.\n"
|
{!modules:%s}\n"
|
||||||
(modules
|
(modules
|
||||||
|> List.sort ~compare:(fun x y ->
|
|> List.sort ~compare:(fun x y ->
|
||||||
Module.Name.compare (Module.name x) (Module.name y))
|
Module.Name.compare (Module.name x) (Module.name y))
|
||||||
|
|
|
@ -41,14 +41,14 @@
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
$ dune build @foo-mld --display short
|
$ dune build @foo-mld --display short
|
||||||
{1 Library foo}
|
{2 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}
|
{2 Library foo.byte}
|
||||||
The entry point of this library is the module:
|
The entry point of this library is the module:
|
||||||
{!module-Foo_byte}.
|
{!module-Foo_byte}.
|
||||||
|
|
||||||
$ dune build @bar-mld --display short
|
$ dune build @bar-mld --display short
|
||||||
{1 Library bar}
|
{2 Library bar}
|
||||||
The entry point of this library is the module:
|
The entry point of this library is the module:
|
||||||
{!module-Bar}.
|
{!module-Bar}.
|
||||||
|
|
Loading…
Reference in New Issue