# Jbuilder (dune), odoc and libraries - incorrectly generated html

**URL:** <https://discuss.ocaml.org/t/jbuilder-dune-odoc-and-libraries-incorrectly-generated-html/1827>\
**Category:** Community\
**Tags:** jbuilder\
**Created:** [April 8, 2018, 8:15am UTC](https://discuss.ocaml.org/t/jbuilder-dune-odoc-and-libraries-incorrectly-generated-html/1827 "2018-04-08T08:15:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![blez](https://avatars.discourse-cdn.com/v4/letter/b/898d66/32.png) [@blez](https://discuss.ocaml.org/u/blez)\
**Post date:** [April 8, 2018, 8:15am UTC](https://discuss.ocaml.org/t/jbuilder-dune-odoc-and-libraries-incorrectly-generated-html/1827/1 "2018-04-08T08:15:17Z")

</div>

I’ve started to create library documentation using jbuilder/odoc and hit a weird issue when I have a library ML file. Thus, given the following simple package:

A private module `src/priv_module.ml`:

```ocaml
(** Private module *)

(** Some private function doc *)
let privfun () = ()

```

The public module `src/pub_module.ml`:

```ocaml
(** Public module *)

(** Some public function doc *)
let pubfun () = ()

```

A library ML file to only export the public module, `src/testlb.ml`:

```ocaml
module Pub_module = Pub_module

```

And the following jbuild file:

```auto
(jbuild_version 1)

(library
 ((name testlib)
  (public_name testlib)
  ))

```

Compilation works fine but when I generate the documentation with `jbuilder build @doc` the testlib/Testlib/index.html file has links to `testlib/Testlib/index.html#module-Pub_module` and not the module documentation.

Changing `src/testlib.ml` to:

```ocaml
module Pub_module = Testlib__Pub_module

```

Fixes the issue but with larger libraries with multiple exported modules I get the following error during compilation:

```auto
Warning 49: no cmi file was found in path for module ...

```

for each of the exported modules. Is this me, odoc or jbuilder(dune)?

**EDIT.**  
Using topkg doc gives the same results

---

<div class="post-metadata">

**Author:** ![blez](https://avatars.discourse-cdn.com/v4/letter/b/898d66/32.png) [@blez](https://discuss.ocaml.org/u/blez)\
**Post date:** [April 9, 2018, 9:05pm UTC](https://discuss.ocaml.org/t/jbuilder-dune-odoc-and-libraries-incorrectly-generated-html/1827/2 "2018-04-09T21:05:26Z")

</div>

[replying to myself!]

At @trefis’s suggestion I upgraded to the git version of dune (jbuilder) which fixed this but adds a couple of other generated document tree problems. I have opened an odoc issue ([ocaml/odoc#113](https://github.com/ocaml/odoc/issues/113)) to track although this may still be an issue with dune (jbuilder) and related to [ocaml/dune#651](https://github.com/ocaml/dune/issues/651)

---

<div class="post-metadata">

**Author:** ![blez](https://avatars.discourse-cdn.com/v4/letter/b/898d66/32.png) [@blez](https://discuss.ocaml.org/u/blez)\
**Post date:** [April 14, 2018, 9:08am UTC](https://discuss.ocaml.org/t/jbuilder-dune-odoc-and-libraries-incorrectly-generated-html/1827/3 "2018-04-14T09:08:48Z")

</div>

[Still talking to myself!]

This was a bug in dune (jbuilder) that has been resolved in dune beta20. Thanks to the dune team
