servant-pandoc 0.1.0.1 → 0.1.0.2
raw patch · 2 files changed
+12/−6 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- servant-pandoc.cabal +1/−1
- src/Servant/Docs/Pandoc.hs +11/−5
servant-pandoc.cabal view
@@ -10,7 +10,7 @@ -- PVP summary: +-+------- breaking API changes -- | | +----- non-breaking API additions -- | | | +--- code changes with no API change-version: 0.1.0.1+version: 0.1.0.2 -- A short (one-line) description of the package. synopsis: Use Pandoc to render servant API documentation
src/Servant/Docs/Pandoc.hs view
@@ -8,14 +8,15 @@ -- follows. -- -- > import Text.Pandoc--- > import Sevant.Docs.Pandoc+-- > import Servant.Docs.Pandoc+-- > import Servant.Docs -- > import Data.Default (def) -- > -- > myApi :: Proxy MyAPI -- > myApi = Proxy -- > -- > writeDocs :: API -> IO ()--- > writeDocs api = writeMediaWiki def (pandoc api) >>= writeFile "api.mw"+-- > writeDocs api = writeFile "api.mw" (writeMediaWiki def (pandoc api)) -- -- The second approach is to use `makeFilter` to make a filter which can be -- used directly with pandoc from the command line. This filter will just@@ -142,7 +143,12 @@ B.bulletList ( [B.plain $ "Status code" <> B.space <> (B.str . show) (resp ^. respStatus)] ++- (resp ^. respBody &- maybe [B.plain "No response body"]- (\b -> [B.plain "Response body as below." <> jsonStr b])))+ case resp ^. respBody of+ [] -> [B.plain "No response body"]+ xs -> map renderResponse xs)+ where+ renderResponse ("", r) =+ B.plain "Response body at below" <> jsonStr r+ renderResponse (ctx, r) =+ B.plain (B.str . unpack $ ctx) <> jsonStr r