diff --git a/neil.cabal b/neil.cabal
--- a/neil.cabal
+++ b/neil.cabal
@@ -1,7 +1,7 @@
 cabal-version:      >= 1.6
 build-type:         Simple
 name:               neil
-version:            0.3
+version:            0.4
 license:            BSD3
 license-file:       LICENSE
 category:           Development
diff --git a/src/Cabal.hs b/src/Cabal.hs
--- a/src/Cabal.hs
+++ b/src/Cabal.hs
@@ -88,8 +88,8 @@
 
 run Docs{..} = Just $ do
     src <- readCabal
-    let [ver] = [trim $ drop 8 x | x <- lines src, "version:" `isPrefixOf` x]
-    let [name] = [trim $ drop 5 x | x <- lines src, "name:" `isPrefixOf` x]
+    let ver = extractCabal "version" src
+    let name = extractCabal "name" src
     system_ $ "cabal haddock --hoogle --hyperlink-source " ++
           "--contents-location=/package/" ++ name
     withTempDir $ \dir -> do
@@ -186,6 +186,13 @@
     case file of
         Nothing -> return []
         Just file -> readFile' file
+
+extractCabal :: String -> String -> String
+extractCabal find = f . words . replace ":" " : "
+    where
+        f (name:":":val:_) | lower find == lower name = val
+        f (x:xs) = f xs
+        f [] = error "Failed to find the Cabal key " ++ find
 
 
 findCabal :: IO (Maybe FilePath)
