Deploy documentation with dune

Dune allows to generate OCamlDoc documentation using dune build @doc. opam has a with-doc target which runs dune build @doc and puts documentation in the .opam folder. Only, it doesn’t put the ocamldoc afaik. Is there a stanza to add, or something to do, so that the ocamldoc is shared.

The answer may be “It’s not possible”, in which case, if you have any input as to why it’s not, whether it just hasn’t been done yet, or it should not be done for some reason.

Thanks

IIRC dune builds docs only for public packages i.e. packages with a public_name field in the library stanza. Does yours have that?

It does, but it’s not the issue of producing a documentation. Adding a (documentation) stanza with some mld files put the files in the .opam directory. The issue is that the _doc directory produced by OCamlDoc is not part of this documentation.