diff --git a/DocTest.hs b/DocTest.hs
new file mode 100644
--- /dev/null
+++ b/DocTest.hs
@@ -0,0 +1,13 @@
+module Main (main) where
+
+import System.FilePath.Glob
+import Test.DocTest
+
+main :: IO ()
+main = do
+    let options =
+            [ "-XOverloadedStrings"
+            ]
+
+    paths <- globDir1 (compile "**/*.hs") "src"
+    doctest $ options ++ paths
diff --git a/LICENSE b/LICENSE
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2015 Pat Brisbin <pbrisbin@gmail.com>
+Copyright (c) 2017 Pat Brisbin <pbrisbin@gmail.com>
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
diff --git a/Setup.hs b/Setup.hs
deleted file mode 100644
--- a/Setup.hs
+++ /dev/null
@@ -1,2 +0,0 @@
-import Distribution.Simple
-main = defaultMain
diff --git a/gravatar.cabal b/gravatar.cabal
--- a/gravatar.cabal
+++ b/gravatar.cabal
@@ -1,37 +1,53 @@
-name:                   gravatar
-version:                0.8.0
-author:                 Pat Brisbin <pbrisbin@gmail.com>
-maintainer:             Pat Brisbin <pbrisbin@gmail.com>
-license:                MIT
-license-file:           LICENSE
-synopsis:               Generate Gravatar image URLs
-description:            Generate Gravatar image URLs
-cabal-version:          >= 1.10
-build-type:             Simple
+cabal-version: 1.12
+name:          gravatar
+version:       0.8.1
+license:       MIT
+license-file:  LICENSE
+maintainer:    Pat Brisbin <pbrisbin@gmail.com>
+author:        Pat Brisbin <pbrisbin@gmail.com>
+homepage:      https://github.com/pbrisbin/gravatar#readme
+bug-reports:   https://github.com/pbrisbin/gravatar/issues
+synopsis:      Generate Gravatar image URLs
+description:   Generate Gravatar image URLs
+build-type:    Simple
 
+source-repository head
+    type:     git
+    location: https://github.com/pbrisbin/gravatar
+
 library
-  default-language:     Haskell2010
-  hs-source-dirs:       src
-  ghc-options:          -Wall
-  exposed-modules:      Network.Gravatar
-  build-depends:        base       >= 4     && < 5
-                      , text       >= 0.11  && < 2.0
-                      , bytestring >= 0.9.1 && < 0.11
-                      , pureMD5                < 3
-                      , HTTP
-                      , data-default
+    exposed-modules:  Network.Gravatar
+    hs-source-dirs:   src
+    other-modules:    Paths_gravatar
+    default-language: Haskell2010
+    ghc-options:      -Wall
+    build-depends:
+        HTTP >=4000.3.12,
+        base >4.8.0 && <5,
+        bytestring >=0.10.8.2,
+        data-default >=0.7.1.1,
+        pureMD5 >=2.1.3,
+        text >=1.2.3.1
 
-test-suite spec
-  type:                 exitcode-stdio-1.0
-  default-language:     Haskell2010
-  hs-source-dirs:       test
-  ghc-options:          -Wall
-  main-is:              Spec.hs
-  build-depends:        base
-                      , hspec
-                      , gravatar
-                      , text
+test-suite doctest
+    type:             exitcode-stdio-1.0
+    main-is:          DocTest.hs
+    hs-source-dirs:   ./
+    other-modules:    Paths_gravatar
+    default-language: Haskell2010
+    ghc-options:      -Wall
+    build-depends:
+        Glob >=0.9.3,
+        base >4.8.0 && <5,
+        doctest >=0.16.0.1
 
-source-repository head
-  type:                 git
-  location:             https://github.com/pbrisbin/gravatar
+test-suite spec
+    type:             exitcode-stdio-1.0
+    main-is:          Spec.hs
+    hs-source-dirs:   test
+    other-modules:    Paths_gravatar
+    default-language: Haskell2010
+    ghc-options:      -Wall
+    build-depends:
+        base >4.8.0 && <5,
+        hspec >=2.5.5
diff --git a/src/Network/Gravatar.hs b/src/Network/Gravatar.hs
--- a/src/Network/Gravatar.hs
+++ b/src/Network/Gravatar.hs
@@ -7,8 +7,8 @@
     , DefaultImg(..)
     , ForceDefault(..)
     , Rating(..)
-    , Scheme (..)
-    , Default(def)
+    , Scheme(..)
+    , def
     , defaultConfig
     ) where
 
@@ -99,6 +99,34 @@
     }
 
 -- | Return the avatar for the given email using the provided options
+--
+-- >>> gravatar def "pbrisbin@gmail.com"
+-- "https://www.gravatar.com/avatar/2be502055b6c21ff470730beead2a998"
+--
+-- Whitespace is trimmed.
+--
+-- >>> gravatar def " pbrisbin@gmail.com   "
+-- "https://www.gravatar.com/avatar/2be502055b6c21ff470730beead2a998"
+--
+-- Case is ignored.
+--
+-- >>> gravatar def "PBrisbin@GMAIL.com"
+-- "https://www.gravatar.com/avatar/2be502055b6c21ff470730beead2a998"
+--
+-- Options are supported.
+--
+-- >>> :{
+--   let opts = GravatarOptions
+--           { gSize = Just $ Size 24
+--           , gDefault = Just NotFound
+--           , gForceDefault = ForceDefault True
+--           , gRating = Just G
+--           , gScheme = Http
+--           }
+--   in gravatar opts "pbrisbin@gmail.com"
+-- :}
+-- "http://www.gravatar.com/avatar/2be502055b6c21ff470730beead2a998?s=24&d=404&f=y&r=g"
+--
 gravatar :: GravatarOptions -> Text -> String
 gravatar opts e = concat
     [ show $ gScheme opts
