-
Notifications
You must be signed in to change notification settings - Fork 464
Description
Package specifications in dune-project do not currently have an entry for documentation. This field is only available project-wide. I am not sure whether this is by design, but it certainly does not map neatly to OPAM files.
OPAM-files currently have a homepage and doc entry. The way I have been using these fields until now was to have homepage point to the github.io page of the project (not the repository) whereas the doc field was set to the API-documentation of that package.
I think it would help to clarify how documentation should be specified. Here is a suggestion on what might work well:
- Rename the project-wide
documentationfielddocto make it more obviously related to the OPAM field of the same name. - Introduce a
homepagefield. - If no project-wide
homepageis provided, its default should be thesource(e.g. GitHub) repository. - If no project-wide
docfield is provided, it should point to whateverhomepageis. - Each package in the project also has a
homepageanddocfield. If a packagehomepageis not provided, it should be the same as the project-widehomepage. If a packagedocpage is not provided, it should be the same as the project-widedocpage if it was explicitly specified. If the project-widedocwas inferred from the project-widehomepageand if a packagehomepagewas provided, the packagehomepageshould be used instead.
The advantage of the above approach is that most projects do not have to specify anything if their GitHub page contains all information, thus keeping project specifications clean and compact. But users can easily define these entries for the whole project and override them on a per-package basis as needed.