dune icon indicating copy to clipboard operation
dune copied to clipboard

Pass --open to odoc for `mld` files

Open favonia opened this issue 3 years ago • 3 comments

It seems helpful to pass the open argument to odoc compile when writing tutorials using mld files to open modules in addition to Stdlib, and I wonder if it makes sense to extend the documentation stanza to include a new option open. Something like this in the dune file:

(documentation (open MyModule1.Child1 MyModule2.Child2))

This means odoc compile for the mld files in the same directory will be run with --open MyModule1.Child1 --open MyModule2.Child2.

favonia avatar May 24 '22 16:05 favonia

@Julow @jonludlam what do you think?

rgrinberg avatar May 24 '22 18:05 rgrinberg

This would be very useful but would prevent other drivers for Odoc to do their job (Odig, v3.ocaml.org). The original mld files are installed, not the compiled form, so other drivers would have to guess what is open.

An alternative is to add an open statement to Odoc's syntax.

Julow avatar May 25 '22 06:05 Julow

If I understand correctly, we won't fix that in dune but users interested in this can use the (not existing yet) feature in odoc?

emillon avatar Jul 28 '22 08:07 emillon

An open statement in mld files is a solution (https://github.com/ocaml/odoc/issues/856) but there's an other solution that can be implemented in Dune: Build and install .odoc files (https://github.com/ocaml/dune/issues/7514)

Julow avatar Apr 07 '23 11:04 Julow