diff options
Diffstat (limited to 'src/Haddock/Backends')
-rw-r--r-- | src/Haddock/Backends/Hoogle.hs | 20 |
1 files changed, 12 insertions, 8 deletions
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) |