From 43004293124cd3082ced37c1af5864b735a5768a Mon Sep 17 00:00:00 2001 From: Neil Mitchell Date: Mon, 16 Jun 2008 07:13:48 +0000 Subject: Change Hoogle to take the package name and package version separately --- src/Haddock/Backends/Hoogle.hs | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src/Haddock/Backends') diff --git a/src/Haddock/Backends/Hoogle.hs b/src/Haddock/Backends/Hoogle.hs index 4c9c7c66..94109d82 100644 --- a/src/Haddock/Backends/Hoogle.hs +++ b/src/Haddock/Backends/Hoogle.hs @@ -25,14 +25,18 @@ import Data.Maybe import System.FilePath -prefix = ["-- Hoogle documentation, generated by Haddock", - "-- See Hoogle, http://www.haskell.org/hoogle/"] - - -ppHoogle :: Maybe String -> [Interface] -> FilePath -> IO () -ppHoogle maybe_package ifaces odir = do - let filename = (fromMaybe "main" maybe_package) <.> "txt" - contents = prefix ++ concat [ppModule i | i <- ifaces, OptHide `notElem` ifaceOptions i] +prefix = ["-- Hoogle documentation, generated by Haddock" + ,"-- See Hoogle, http://www.haskell.org/hoogle/" + ,""] + + +ppHoogle :: String -> String -> [Interface] -> FilePath -> IO () +ppHoogle package version ifaces odir = do + let filename = package <.> "txt" + contents = prefix ++ + ["@package " ++ package] ++ + ["@version " ++ version | version /= ""] ++ + concat [ppModule i | i <- ifaces, OptHide `notElem` ifaceOptions i] writeFile (odir filename) (unlines contents) -- cgit v1.2.3