servant-pandoc: Use Pandoc to render servant API documentation

[ library, mit, servant, web ] [ Propose Tags ]

Use pandoc to generate documentation for your Servant API.

[Skip to Readme]
Versions [faq] 0.1,,, 0.4.0, 0.4.1,,,,,
Change log CHANGELOG
Dependencies base (>=4.7 && <5), bytestring (==0.10.*), case-insensitive (>=0.2 && <1.3), http-media (>=0.6 && <0.8), lens (>=4.9 && <5), pandoc-types (>=1.12 && <1.18), servant-docs (==0.11.*), string-conversions (>=0.1 && <0.5), text (==1.2.*), unordered-containers (==0.2.*) [details]
License MIT
Author Matthew Pickering, Ivan Miljenovic
Category Web
Source repo head: git clone
Uploaded by IvanMiljenovic at Tue Jul 25 06:18:37 UTC 2017
Distributions LTSHaskell:, NixOS:
Downloads 3799 total (192 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2017-07-25 [all 1 reports]




Maintainer's Corner

For package maintainers and hackage trustees

Readme for servant-pandoc-

[back to package description]

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 ""
 (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