removed Servant.Docs.printMarkdown

This commit is contained in:
Sönke Hahn 2014-11-14 19:54:38 +08:00
parent 49c301d26e
commit 102c752268
2 changed files with 9 additions and 12 deletions

View file

@ -102,4 +102,4 @@ main = do
print =<< runEitherT (deleteGreet "blah" uri)
killThread tid
putStrLn "\n---------\n"
printMarkdown docsGreet
putStrLn $ markdown docsGreet

View file

@ -16,13 +16,13 @@
--
-- @docs :: 'HasDocs' api => 'Proxy' api -> 'API'@
--
-- You can then call 'printMarkdown' on it:
-- You can then call 'markdown' on it:
--
-- @printMarkdown :: 'API' -> IO ()@
-- @printMarkdown :: 'API' -> String@
--
-- or define a custom pretty printer:
--
-- @yourPrettyDocs :: 'API' -> IO () -- or blaze-html's HTML, or ...@
-- @yourPrettyDocs :: 'API' -> String -- or blaze-html's HTML, or ...@
--
-- The only thing you'll need to do will be to implement some classes
-- for your captures, get parameters and request or response bodies.
@ -70,7 +70,7 @@
-- > toCapture _ = DocCapture "greetid" "identifier of the greet msg to remove"
-- >
-- > -- API specification
-- > type TestApi =
-- > type TestApi =
-- > "hello" :> Capture "name" Text :> QueryParam "capital" Bool :> Get Greet
-- > :<|> "greet" :> RQBody Greet :> Post Greet
-- > :<|> "delete" :> Capture "greetid" Text :> Delete
@ -83,10 +83,10 @@
-- > greetDocs = docs testApi
-- >
-- > main :: IO ()
-- > main = printMarkdown greetDocs
-- > main = putStrLn $ markdown greetDocs
module Servant.Docs
( -- * 'HasDocs' class and key functions
HasDocs(..), docs, markdown, printMarkdown
HasDocs(..), docs, markdown
, -- * Classes you need to implement for your types
ToSample(..)
@ -355,11 +355,8 @@ class ToParam t where
class ToCapture c where
toCapture :: Proxy c -> DocCapture
-- | Print documentation in Markdown format for
-- the given 'API', on standard output.
printMarkdown :: API -> IO ()
printMarkdown = print . markdown
-- | Generate documentation in Markdown format for
-- the given 'API'.
markdown :: API -> String
markdown = unlines . concat . map (uncurry printEndpoint) . HM.toList