Skip to content

Commit

Permalink
module docs + added a script to generate haddocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Frank Staals authored and Frank Staals committed Jun 11, 2016
1 parent 514c1c9 commit 7b58195
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
26 changes: 26 additions & 0 deletions hackagedocs.sh
Original file line number Diff line number Diff line change
@@ -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

6 changes: 6 additions & 0 deletions src/Data/Geometry.hs
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 6 additions & 0 deletions src/Data/Geometry/Polygon/Convex.hs
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 7b58195

Please sign in to comment.