servant-pandoc

Use Pandoc to render servant API documentation

Version on this page:0.4.1.4
LTS Haskell 13.30:0.5.0.0
Stackage Nightly 2019-05-12:0.5.0.0
Latest on Hackage:0.5.0.0

See all snapshots servant-pandoc appears in

MIT licensed by Matthew Pickering, Ivan Miljenovic
Maintained by [email protected]
This version can be pinned in stack with:servant-pandoc-0.4.1.4@sha256:7f73980e553e702d868bb63e20b10d3352fcf3b9b04713089d493d25da2f621d,1342

Module documentation for 0.4.1.4

There are two ways in which to use this module.

The first is to use the renderer directly with the pandoc API. A very simple program to render the API documentation as a mediawiki document might look as follows.

 import Text.Pandoc import Servant.Docs.Pandoc import Servant.Docs
 import Data.Default (def)

 myApi :: Proxy MyAPI myApi = Proxy

 writeDocs :: API -\> IO () 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 append the API documentation to the end of the document. Example usage

-- api.hs
main :: IO ()
main = makeFilter (docs myApi)

> pandoc -o api.pdf --filter=api.hs manual.md