Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to disable documentation (at least for generated opam files) #5519

Open
sim642 opened this issue Mar 14, 2022 · 3 comments
Open

Option to disable documentation (at least for generated opam files) #5519

sim642 opened this issue Mar 14, 2022 · 3 comments

Comments

@sim642
Copy link

sim642 commented Mar 14, 2022

Currently (generate_opam_files true) will effectively unconditionally generate opam files, which include "odoc" {with-doc} under depends and "@doc" {with-doc} in build. There are packages, which often include no documentation: executable-only packages (#1496) or ppx packages (technically contain libraries, but not intended for usage as normal library). In such cases there are currently the following possibilities:

  1. Have a practically unused odoc dependency.
  2. Manually remove those parts from the generated opam files, which is annoying.
  3. Manually write some .mld documentation for the executable/ppx such that the documentation wouldn't be completely pointless.

Such practically unused documentations are especially visible in https://v3.ocaml.org/packages, even when the package itself intentionally doesn't publish documentation on GitHub Pages of its own repository or whereever. Manually written filler documentation (3. from above) is even less useful on the new site because the README is already shown, which for executables and ppxs likely already contains useful information. There wouldn't be any point maintaining an analogous .mld document.

Therefore, it would be useful to have a way to disable documentation dependency and generation for automatically produced opam files. Or possibly even have the option apply more generally to even the availability of the @doc alias, not just for opam file generation.

Depending on the scope of the option, it could be a top-level stanza like (documentation ...) in dune-project or just an argument of (generate_opam_files ...) instead of just true.

@bobot
Copy link
Collaborator

bobot commented Mar 15, 2022

It is reasonnable, my two cents for the placement. If it is outside generate_opam_files, it should also disable the @docalias. So I would prefer inside generate_opam_files. If at some point we add the external one we always can make it change the default of generate_opam_files. We can have something like (generate_opam_files (doc <true|false>) (tests <true|false>)). (or ẁith_doc instead of doc?)

@rgrinberg
Copy link
Member

What about disabling documentation per package? E.g. something like:

(package
 (name foo)
 (documentation disabled))

@sim642
Copy link
Author

sim642 commented Apr 15, 2022

That probably would be the most flexible option indeed to handle more sophisticated projects containing multiple packages with different documentation needs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants