ocaml / dune

A composable build system for OCaml.
https://dune.build/
MIT License
1.63k stars 401 forks source link

doc: install html documentation #3495

Open sternenseemann opened 4 years ago

sternenseemann commented 4 years ago

Desired Behavior

I'd like to have at least the option or a simple way to add the generated html docs to the install target, so they'd maybe be installed to prefix/doc/<package>/html or similar.

Also this could possibly be used to solve the issue of documentation of dependencies (#3436, #1949) in the future, although it also would have some problems: You could discover the path of the installed documentation of dependencies and link the relevant types/functions/modules to there. This would be similar to how it is possible with haddock of the Haskell infrastructure.

jonludlam commented 4 years ago

Right now odig is usually used for generating documentation for installed packages - does this work for you? I'm not saying there aren't questions about what we should do with the docs generated by dune, just trying to fix the immediate issue.

sternenseemann commented 4 years ago

Yeah, that works great, but it'd be nice to have a way to add that documentation to the install target, so that it'd be installed to prefix/doc alongside CHANGES.md, README.md etc.

jonludlam commented 4 years ago

You should be able to add (documentation) to your dune file it'll install mld files that odoc will use - see https://dune.readthedocs.io/en/stable/documentation.html - does that help?

sternenseemann commented 4 years ago

I already use that, but it doesn't install the html output of odig unfortunately which is what I want. Also there doesn't seem to be a good way to have a target for those (or I couldn't figure it out from the docs).