hackage-server icon indicating copy to clipboard operation
hackage-server copied to clipboard

Create permanent urls to latest hackage package documentation

Open malteneuss opened this issue 4 years ago • 3 comments

For frequently used Haskell packages, i like to bookmark the documentation pages. That's why i would like to propose having urls pointing to the newest hackage package documentation version. Currently, urls contain the package version like

https://hackage.haskell.org/package/base-4.15.0.0/docs/Data-Traversable.html

I know there is the possibility to remove the version number from the url like

https://hackage.haskell.org/package/base/docs/Data-Traversable.html

but this needs manual work when bookmarking and redirects back to an url with a package version. So the bookmarked url and the page url are never the same, so you can't see which hackage page is already bookmarked, and everytime a package updates, it requires manual new bookmarks (this is not frequent with stable base packages, but painful with newer, still evolving packages).

Instead it would be good to have permanent urls like

https://hackage.haskell.org/package/base-latest/docs/Data-Traversable.html (preferred)
https://hackage.haskell.org/package/base/latest/docs/Data-Traversable.html

that don't redirect like for ghc documentation, e.g. https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/exts/template_haskell.html. Those urls could be promoted in search engines to avoid having long outdated package versions showing up in the top results.

malteneuss avatar Sep 26 '21 12:09 malteneuss

I agree that having GHC's latest urls approach extended to Hackage would be worthwhile. One thing I think you got wrong is:

and every time a package updates, it requires manual new bookmarks

I think you can avoid that if you (only once) manually edit the bookmark to point the the non-versioned url.

ulysses4ever avatar Sep 26 '21 16:09 ulysses4ever

I think you can avoid that if you (only once) manually edit the bookmark to point the the non-versioned url.

That's what i'm currently doing. However as i said, the bookmarked url and the page url are never the same, so you can't see which hackage page is already bookmarked. And many duplicate, outdated package version are on the top of the search engine results, just because they were popular for some short time in the past.

malteneuss avatar Sep 27 '21 09:09 malteneuss

Hackage server doesn't have a notion of special urls for special package docs -- anything we do should be able to be uniform for all docs. I don't think its particularly great to have canonical docs be version independent, as modules can disappear between releases, and this would cause links that used to work to stop working. The search engine results problem is very real, and I'm not sure of the right way to approach it -- there are some tickets littered about on this question.

cf https://github.com/haskell/hackage-server/issues/504 and https://github.com/haskell/hackage-server/issues/198

gbaz avatar Sep 27 '21 17:09 gbaz