ocaml / odoc

Documentation compiler for OCaml and Reason
Other
321 stars 90 forks source link

Feature request: pragma to open a module in mld files #856

Open favonia opened 2 years ago

favonia commented 2 years ago

Following the discussion of https://github.com/ocaml/dune/issues/5770, it seems we should invent some pragma directive in (the header of?) an mld file that has the same effect of passing the --open option to odoc. This is to make sure that odig and other tools can compile installed mld files with the intended --open options. This feature would also solve https://github.com/ocaml/odoc/issues/805.

favonia commented 2 years ago

How about the following syntax to pass command-line arguments? They must appear before everything else (except whitespace).

(*!odoc --open M.X.Y *)
(*!maybe_another_tool --arg1 --arg2 blah *)

Not that I'm a big fan of this syntax, but I don't want us to be stuck at searching for perfect designs.

dbuenzli commented 2 years ago

OCaml comments are regular text in .mld files so I don't think that would work.

I suspect this is related and should be designed with https://github.com/ocaml/odoc/issues/636 in mind.

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. The main purpose of this is to keep the issue tracker focused to what is actively being worked on, so that the amount and variety of open yet inactive issues does not overwhelm contributors.

An issue closed as stale is not rejected — further discussion is welcome in its closed state, and it can be resurrected at any time. odoc maintainers regularly check issues that were closed as stale in the past, to see if the time is right to reopen and work on them again. PRs addressing issues closed as stale are as welcome as PRs for open issues. They will be given the same review attention, and any other help.