PROPOSAL: Publish haddock documentation for all CHaP packages. #715
Replies: 5 comments 2 replies
-
Note that Our CI already builds (most) packages, so I don't think it would be too expensive to do 1 or 2. The hard part is building it, i.e. 3&4. I don't know how |
Beta Was this translation helpful? Give feedback.
-
Also this is obviously massively desirable, it's just quite non-trivial. |
Beta Was this translation helpful? Give feedback.
-
I always wondered if we could use some sphinx cross ref logic. That should allow some federated links between different hackages as well. It might be a bit far out though. |
Beta Was this translation helpful? Give feedback.
-
Hi @jonathanknowles, thanks for writing this up. I agree that everything you list here is desirable. Indeed we have already been building haddocks for all packages in our hydra ci. https://ci.iog.io/jobset/input-output-hk-cardano-haskell-packages/main/latest-eval?filter=haddock The problem that has always stopped me from pushing this further is this: haddock generated documentation depends on the exact build configuration. This include ghc version, platform, dependencies, pkg-config, etc. What we do in hydra at the moment is building haddock idependently for each single If you want to work on this, I would be very happy to support your efforts. The URL schema you can use is
e.g.
Building the documentation for the whole package rather than by components would be a good first step. Perhaps it's trivial, I admit I haven't looked at this for a while. |
Beta Was this translation helpful? Give feedback.
-
Ad 3. & 4. I recently stumbled on a similar problem with |
Beta Was this translation helpful? Give feedback.
-
Proposal
Publish versioned Haddock documentation for all CHaP packages, in the style of Hackage.
Terminology
In the context of this proposal, the terms "documentation" and "API documentation" mean "Haddock API documentation for a Haskell package", as built with the Haddock tool.
Motivation
Lower the barrier of entry for developers wishing to:
In particular, a single, integrated place for API documentation would mean that:
Developers wishing to understand existing packages can read API documentation:
Developers wishing to understand dependencies of existing packages can reach and browse the API documentation for those packages just by following ordinary hyperlinks.
Developers wishing to author or maintain packages can publish their API documentation:
The last point is of particular interest to those who wish to author libraries for the Cardano Haskell ecosystem. Under this proposal, a library author could upload their package to CHaP, and then take advantage of the shared documentation publication facilities that CHaP provides, saving a potentially large amount of duplicated effort.
Proposed acceptance criteria
☑️ 1. Publication of documentation for new package versions
After a user adds a new version
v
of packagep
to CHaP, then CHaP should:Attempt to compile the documentation for version
v
of packagep
;Assuming compilation is successful, publish it at the following URL:
https://chap.intersectmbo.org/package/p-v
The above URL scheme is similar to the one used by Hackage:
https://hackage.haskell.org/package/p-v
Documentation should be published within a reasonable time frame, where "reasonable" can be interpreted as "similar to the length of time that Hackage would require to build and publish documentation".
☑️ 2. Preservation of documentation for historical package versions
CHaP should preserve all documentation that is already published for historical versions of packages.
In particular, if CHaP already has published documentation for version
v1
of packagep
, then uploading versionv2
of the same package should not cause the documentation forv1
to become unavailable.This is similar to Hackage, which preserves documentation for historical versions of packages.
☑️ 3. Hyperlinks between CHaP packages
Assuming:
p1
andp2
are both packages published on CHaP;p2
includes one or more usages of a symbols
exported from the public interface ofp1
;s
is an entity that Haddock can reference with a hyperlink;Then usages of
s
within the published documentation forp2
should have hyperlinks that resolve to the definition ofs
within the published documentation forp1
.☑️ 4. Hyperlinks from CHaP packages to Hackage packages
Assuming:
p1
is a package published on Hackage;p2
is a package published on CHaP;p2
includes one or more usages of a symbols
exported from the public interface ofp1
;s
is an entity that Haddock can reference with a hyperlink;Then usages of
s
within the published documentation forp2
on CHaP should have hyperlinks that point to the definition ofs
within the published documentation forp1
on Hackage.Beta Was this translation helpful? Give feedback.
All reactions