@@ -0,0 +1,18 @@
1+#!/bin/bash
2+
3+# Run this script in the top-level of your package directory
4+# (where the .cabal file is) to compile documentation and
5+# upload it to hackage.
6+
7+# Requirements:
8+# cabal-install-1.24 (for --for-hackage)
9+# haddock 2.17 (for the hyperlinked source)
10+
11+set -e
12+
13+dir=$(mktemp -d dist-docs.XXXXXX)
14+trap 'rm -r "$dir"' EXIT
15+
16+cabal configure --builddir="$dir"
17+cabal haddock --builddir="$dir" --for-hackage --haddock-option=--hyperlinked-source
18+cabal upload -d $dir/*-docs.tar.gz