ocaml/dune

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

開放

#5,519 建立於 2022年3月14日

 (3 則留言) (0 個反應) (0 位負責人)OCaml (478 個分叉)github user discovery
enhancementhelp wanted

倉庫指標

星標
 (1,882 顆星)
PR 合併指標
 (平均合併 1天 20小時) (30 天內合併 345 個 PR)

描述

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.

貢獻者指南