From 7b58195c8466285a7180db36ddc2c3e0c5148b52 Mon Sep 17 00:00:00 2001 From: Frank Staals Date: Sat, 11 Jun 2016 11:56:29 +0200 Subject: [PATCH] module docs + added a script to generate haddocks --- hackagedocs.sh | 26 ++++++++++++++++++++++++++ src/Data/Geometry.hs | 6 ++++++ src/Data/Geometry/Polygon/Convex.hs | 6 ++++++ 3 files changed, 38 insertions(+) create mode 100644 hackagedocs.sh diff --git a/hackagedocs.sh b/hackagedocs.sh new file mode 100644 index 000000000..73ca3acea --- /dev/null +++ b/hackagedocs.sh @@ -0,0 +1,26 @@ +#!/bin/sh +# Based on https://gist.github.com/Fuuzetsu/8276421 +# Usage: sh hackagedocs.sh 0.7.1 UserName Password +PKG_NAME=hgeometry + +stack configure && stack build && stack haddock --hyperlink-source --html-location='http://hackage.haskell.org/package/$pkg/docs' \ + --contents-location='http://hackage.haskell.org/package/$pkg' +S=$? +if [ "${S}" -eq "0" ]; then + cd "dist/doc/html" + DDIR="${PKG_NAME}-${1}-docs" + cp -r "${PKG_NAME}" "${DDIR}" && tar -c -v -z --format ustar -f "${DDIR}.tar.gz" "${DDIR}" + CS=$? + if [ "${CS}" -eq "0" ]; then + echo "Uploading to Hackageā€¦" + curl -X PUT -H 'Content-Type: application/x-tar' -H 'Content-Encoding: gzip' --data-binary "@${DDIR}.tar.gz" "http://${2}:${3}@hackage.haskell.org/package/${PKG_NAME}-${1}/docs" + exit $? + else + echo "Error when packaging the documentation" + exit $CS + fi +else + echo "Error when trying to build the package." + exit $S +fi + diff --git a/src/Data/Geometry.hs b/src/Data/Geometry.hs index 6a0f2d846..1d31484c6 100644 --- a/src/Data/Geometry.hs +++ b/src/Data/Geometry.hs @@ -1,3 +1,9 @@ +{-| +Module : Data.Geometry +Description: Basic Geometry types +Copyright : (c) Frank Staals +License : See LICENCE file +-} module Data.Geometry( module Data.Geometry.Properties , module Data.Geometry.Transformation , module Data.Geometry.Point diff --git a/src/Data/Geometry/Polygon/Convex.hs b/src/Data/Geometry/Polygon/Convex.hs index fd3159a2b..f786e36ec 100644 --- a/src/Data/Geometry/Polygon/Convex.hs +++ b/src/Data/Geometry/Polygon/Convex.hs @@ -1,4 +1,10 @@ {-# LANGUAGE ScopedTypeVariables #-} +{-| +Module : Data.Geometry.Polygon.Convex +Description: Convex Polygons +Copyright : (c) Frank Staals +License : See LICENCE file +-} module Data.Geometry.Polygon.Convex( ConvexPolygon , merge , lowerTangent, upperTangent