6cabal_file=$(find . -maxdepth 1 -name "*.cabal" -print -quit)
7if [ ! -f "$cabal_file" ]; then
8 echo "Run this script in the top-level package directory"
16 echo "Unable to determine package name"
21 echo "Unable to determine package version"
25echo "Detected package: $pkg-$ver"
27dir=$(mktemp -d build-docs.XXXXXX)
28trap 'rm -r "$dir"' EXIT
30cabal haddock --hoogle --hyperlink-source --html-location='/package/$pkg-$version/docs' --contents-location='/package/$pkg-$version'
32cp -R dist/doc/html/$pkg/ $dir/$pkg-$ver-docs
34tar cvz -C $dir --format=ustar -f $dir/$pkg-$ver-docs.tar.gz $pkg-$ver-docs
37 -H 'Content-Type: application/x-tar' \
38 -H 'Content-Encoding: gzip' \
40 --data-binary "@$dir/$pkg-$ver-docs.tar.gz" \
41 "https://hackage.haskell.org/package/$pkg-$ver/docs"
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list