haddocset 0.1.0 → 0.2.0
raw patch · 3 files changed
+28/−24 lines, 3 filesdep +conduit-extradep +exceptionsdep +haddock-apidep −filesystem-conduitdep ~Cabaldep ~conduitdep ~ghc
Dependencies added: conduit-extra, exceptions, haddock-api, mtl, resourcet
Dependencies removed: filesystem-conduit
Dependency ranges changed: Cabal, conduit, ghc, haddock, optparse-applicative, process, sqlite-simple, system-fileio, system-filepath, tagsoup, text, transformers
Files
- Documentation/Haddocset.hs +8/−7
- Main.hs +2/−2
- haddocset.cabal +18/−15
Documentation/Haddocset.hs view
@@ -9,15 +9,16 @@ module Documentation.Haddocset where import Control.Applicative-import Control.Exception+import Control.Monad.Catch import Control.Monad+import Control.Monad.Trans.Resource import Control.Monad.IO.Class import qualified Filesystem as P import qualified Filesystem.Path.CurrentOS as P import System.IO-import System.IO.Error+import System.IO.Error(mkIOError, alreadyExistsErrorType, isDoesNotExistError) import System.Process import qualified Database.SQLite.Simple as Sql@@ -175,17 +176,17 @@ P.</> docRationalDir doc liftIO $ P.createTree (P.directory dst) ex <- liftIO $ (||) <$> P.isFile dst <*> P.isDirectory dst- when ex $ monadThrow $ mkIOError alreadyExistsErrorType "copyDocument" Nothing (Just $ P.encodeString dst)+ when ex $ throwM $ mkIOError alreadyExistsErrorType "copyDocument" Nothing (Just $ P.encodeString dst) case P.extension $ docRationalDir doc of Just "html" -> liftIO $ copyHtml doc dst Just "haddock" -> return () _ -> liftIO $ P.copyFile full dst -docFiles :: MonadIO m => PackageId -> [P.FilePath] -> Producer m DocFile+docFiles :: (MonadIO m, MonadResource m) => PackageId -> [P.FilePath] -> Producer m DocFile docFiles sourcePackageId haddockHTMLs = forM_ haddockHTMLs $ \dir ->- P.traverse False dir- =$= awaitForever (\f -> yield $ DocFile sourcePackageId dir $ fromMaybe (error $ "Prefix missmatch: " ++ show (dir ,f)) $ P.stripPrefix dir f)+ P.sourceDirectoryDeep False (P.encodeString dir)+ =$= awaitForever (\f -> yield $ DocFile sourcePackageId dir $ fromMaybe (error $ "Prefix missmatch: " ++ show (dir ,f)) $ P.stripPrefix dir (P.decodeString f)) data Provider = Haddock PackageId P.FilePath@@ -283,7 +284,7 @@ where go = do putStr " " >> putStr (display $ diPackageId iFile) >> putChar ' ' >> hFlush stdout- docFiles (diPackageId iFile) (diHTMLs iFile)+ runResourceT $ docFiles (diPackageId iFile) (diHTMLs iFile) $$ (if quiet then id else (progress False 10 '.' =$)) (copyDocument docDir) Sql.execute_ conn "BEGIN;" ( moduleProvider iFile
Main.hs view
@@ -107,7 +107,7 @@ <$> (strOption (long "CFBundleIdentifier") <|> pure "haskell") <*> (strOption (long "CFBundleName") <|> pure "Haskell") <*> (strOption (long "DocSetPlatformFamily") <|> pure "haskell"))- <*> many (argument (Just . P.decodeString) (metavar "CONFS" <> help "path to installed package configuration."))+ <*> many (argument (P.decodeString <$> str) (metavar "CONFS" <> help "path to installed package configuration.")) - addOpts = Add <$> some (argument (Just . P.decodeString) (metavar "CONFS" <> help "path to installed package configuration."))+ addOpts = Add <$> some (argument (P.decodeString <$> str) (metavar "CONFS" <> help "path to installed package configuration."))
haddocset.cabal view
@@ -1,5 +1,5 @@ name: haddocset-version: 0.1.0+version: 0.2.0 synopsis: Generate docset of Dash by Haddock haskell documentation tool description: please read README.md <https://github.com/philopon/haddocset/blob/master/README.md> license: BSD3@@ -17,21 +17,24 @@ main-is: Main.hs other-modules: Documentation.Haddocset ghc-options: -Wall -O2- build-depends: base >=4.6 && <4.8- , ghc >=7.4- , optparse-applicative >=0.7- , conduit >=1.0- , filesystem-conduit >=1.0- , tagsoup >=0.13- , Cabal >=1.16- , text >=1.0- , sqlite-simple >=0.4.5- , process >=1.1- , system-filepath >=0.4- , system-fileio >=0.3- , transformers >=0.3+ build-depends: base >=4.6 && <4.8+ , ghc >=7.4 && <7.9+ , optparse-applicative >=0.11 && <0.12+ , conduit >=1.0 && <1.3+ , conduit-extra >=1.1 && <1.2+ , tagsoup >=0.13 && <1.4+ , Cabal >=1.16 && <1.21+ , text >=1.0 && <1.3+ , sqlite-simple >=0.4.5 && <0.5+ , process >=1.1 && <1.3+ , system-filepath >=0.4 && <0.5+ , system-fileio >=0.3 && <0.4+ , transformers >=0.3 && <0.5+ , exceptions >=0.6 && <0.7+ , resourcet >=1.1 && <1.2+ , mtl >=2.0 && <2.2 if impl(ghc >= 7.8)- build-depends: haddock >=2.14+ build-depends: haddock-api >=2.15 else build-depends: haddock >=2.13 && <2.14