-
Notifications
You must be signed in to change notification settings - Fork 411
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
Warn when documenting an executable produces empty documentation #1496
Comments
Something like this expected with how odoc is currently conceived, which is a tool for documenting OCaml/Reason APIs. Since an executable doesn't expose an API, there would typically be nothing to document. The executable's documentation would be in its man pages, Of course, the actual HTML output produced by Dune+odoc for an executable might be messy right now. Maybe we need to avoid empty index files, or print a warning explaining why an empty file was generated, or why Dune wanted to generate an empty index, and what the rationale for that is. And, of course, discussion of this reasoning is welcome :) |
I see, this makes sense. I support the need for some kind of a warning. |
@rgrinberg I can take care of this as my first proper Dune issue, though I need to work on some other things in odoc first. |
Can we make such a warning be displayed only in the dev profile? I think that when we build docs for packages in "production", we do it in bulk and we don't really care if a particular package has no docs. |
I think it would actually be useful to have documentation for executables. Often I want to document a script I'm working on but creating a separate library feels unnecessary.
Do you have any particular examples of that? For example, using the Currently dune only supplies cmti files to odoc when compiling documentation: Line 134 in c3b32de
Maybe for binaries it could use Alternatively I think not generating docs for executables is better than generating empty output, even if there's a warning. |
When running
dune build @doc
in a project only containing a package consisting of an executable, odoc does not produce anything but almost empty index files.dune build @doc-private
does not produce anything at all.It is maybe expected that non-library code does not need documentation pages, but it might be not that obvious.
MNWE:
The text was updated successfully, but these errors were encountered: