packages feed

apiary 0.12.1 → 0.12.2

raw patch · 5 files changed

+21/−20 lines, 5 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Control.Monad.Apiary.Action: documentAction :: ApiaryConfig -> Documents -> ActionT IO ()
+ Control.Monad.Apiary.Action: defaultDocumentationAction :: Monad m => ByteString -> Documents -> ActionT m ()
+ Control.Monad.Apiary.Action: documentationAction :: ApiaryConfig -> Documents -> ActionT IO ()

Files

apiary.cabal view
@@ -1,8 +1,8 @@ name:                apiary-version:             0.12.1-synopsis:            Simple and type safe web framework that can be automatically generate API document.+version:             0.12.2+synopsis:            Simple and type safe web framework that can be automatically generate API documentation. description:-  Simple and type safe web framework that can be automatically generate API document.+  Simple and type safe web framework that can be automatically generate API documentation.   .   @   &#123;-&#35; LANGUAGE QuasiQuotes &#35;-&#125;@@ -35,7 +35,7 @@   .     * type safe route filter.   .-    * auto generate API documentation(<https://github.com/philopon/apiary/blob/master/examples/api.hs>).+    * auto generate API documentation(example: <https://github.com/philopon/apiary/blob/master/examples/api.hs>, <https://rawgit.com/philopon/apiary/master/examples/api.html>).   .   more examples: <https://github.com/philopon/apiary/blob/master/examples/> 
src/Control/Monad/Apiary/Action.hs view
@@ -36,6 +36,7 @@     -- * Reexport     , module Data.Default.Class     , module Network.HTTP.Types.Status+    , defaultDocumentationAction          -- * deprecated     , redirectFound, redirectSeeOther, source
src/Control/Monad/Apiary/Action/Internal.hs view
@@ -41,19 +41,19 @@  data ApiaryConfig = ApiaryConfig     { -- | call when no handler matched.-      notFound       :: Application+      notFound            :: Application       -- | used unless call 'status' function.-    , defaultStatus  :: Status+    , defaultStatus       :: Status       -- | initial headers.-    , defaultHeader  :: ResponseHeaders+    , defaultHeader       :: ResponseHeaders       -- | used by 'Control.Monad.Apiary.Filter.root' filter.-    , rootPattern    :: [S.ByteString]-    , mimeType       :: FilePath -> S.ByteString-    , documentAction :: Documents -> ActionT IO ()+    , rootPattern         :: [S.ByteString]+    , mimeType            :: FilePath -> S.ByteString+    , documentationAction :: Documents -> ActionT IO ()     } -defaultDocument :: Monad m => S.ByteString -> Documents -> ActionT m ()-defaultDocument r d = do+defaultDocumentationAction :: Monad m => S.ByteString -> Documents -> ActionT m ()+defaultDocumentationAction r d = do     p <- rawPathInfo <$> getRequest     guard $ p == r     contentType "text/html"@@ -68,12 +68,12 @@  instance Default ApiaryConfig where     def = ApiaryConfig -        { notFound       = defNotFound-        , defaultStatus  = ok200-        , defaultHeader  = []-        , rootPattern    = ["", "/", "/index.html", "/index.htm"]-        , mimeType       = defaultMimeLookup . T.pack-        , documentAction = defaultDocument "/api/document"+        { notFound            = defNotFound+        , defaultStatus       = ok200+        , defaultHeader       = []+        , rootPattern         = ["", "/", "/index.html", "/index.htm"]+        , mimeType            = defaultMimeLookup . T.pack+        , documentationAction = defaultDocumentationAction "/api/documentation"         }  convFile :: (S.ByteString, P.FileInfo L.ByteString) -> File
src/Control/Monad/Apiary/Internal.hs view
@@ -108,7 +108,7 @@             -> ApiaryT '[] n m a -> m (Application, Documents) runApiaryT' run conf m = unApiaryT m (initialReader conf) (\_ w -> return w) >>= \wtr -> do     let doc = docsToDocuments $ writerDoc wtr-        app = execActionT conf $ hoistActionT run (writerHandler wtr) `mplus` documentAction conf doc+        app = execActionT conf $ hoistActionT run (writerHandler wtr) `mplus` documentationAction conf doc     return (app, doc)  runApiaryT :: (Monad n, Monad m) => (forall b. n b -> IO b) -> ApiaryConfig
src/Data/Apiary/Document.hs view
@@ -124,7 +124,7 @@ defaultDocumentToHtml docs = H.docTypeHtml $ H.head headH <> H.body body   where     css u = H.link ! A.rel "stylesheet" ! A.href u-    headH = H.title "API document" <>+    headH = H.title "API documentation" <>         css "//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"      htmlQR (Strict   r) = toHtml (show r)