servant-pandoc alternatives and similar packages
Based on the "servant" category.
Alternatively, view servant-pandoc alternatives based on common mentions on social networks and blogs.
-
servant
Main repository for the servant libraries — DSL for describing, serving, querying, mocking, documenting web applications and more! -
servant-elm
Automatically derive Elm functions to query servant webservices -
servant-purescript
Translate servant API to purescript code, with the help of purescript-bridge. -
servant-swagger-ui
Provide embedded swagger UI for servant and swagger -
servant-response
Moved to http://github.com/haskell-servant -
servant-js
Automatically derive javascript functions to query servant webservices. -
servant-auth-cookie
Authentication via encrypted cookies -
servant-aeson-specs
Generically obtain tests for JSON serialization -
servant-github-webhook
Servant combinators for writing secure GitHub webhooks -
servant-mock
Derive a mock server for free from your servant API types -
servant-pagination
Type-safe pagination for Servant APIs -
servant-matrix-param
Matrix parameter combinator for servant -
servant-auth-token-leveldb
Servant based API and server for token based authorisation -
servant-auth-token-acid
Servant based API and server for token based authorisation -
servant-jsonrpc
Tools to build JSON-RPC clients and servers the Servant way -
servant-reason
Automatically derive bindings for Servant APIs in Reason -
servant-kotlin
Automatically derive Kotlin functions to query servant webservices -
servant-http2-client
Generate http2-client from Servant APIs -
servant-ruby
Create a Ruby client from a Servant API using Net::HTTP. -
servant-match
Standalone implementation of servant’s dispatching mechanism -
servant-options
Provide responses to OPTIONS requests for Servant applications. -
servant-generate
Generate default implementations for servers in a flexible way (a.k.a servant-mock on steroids) -
servant-proto-lens
Servant Content-Type for proto-lens protobuf modules. -
servant-haxl-client
automatical derivation of querying functions for servant webservices -
servant-multipart
multipart/form-data (e.g file upload) support for servant
Static code analysis for 29 languages.
Do you think we are missing an alternative of servant-pandoc or a related project?
README
An extension to servant-docs that allows you to use Pandoc to render your Servant API documentation.
How to use this package
Generate documentation directly
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))
Create a Pandoc filter
The makeFilter
function allows you 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)
Then to run this:
pandoc -o api.pdf --filter=api.hs manual.md
Custom filters
A more sophisticated filter might be to actually convert introduction
and note bodies to Markdown before processing (note: this is not
enabled by default as the pandoc
library is GPL-licensed, whereas
this library uses pandoc-types
which is BSD3-licensed):
import Data.Monoid (mconcat, (<>))
import Servant.Docs.Pandoc (pandoc)
import Text.Pandoc (readMarkdown)
import Text.Pandoc.JSON (Block(Para, Plain), Inline(Str), Pandoc(Pandoc),
toJSONFilter)
import Text.Pandoc.Options (def)
import Text.Pandoc.Walk (walkM)
main :: IO ()
main = toJSONFilter append
where
append :: Pandoc -> Pandoc
append = (<> mconcat (walkM parseMarkdown (pandoc myApi)))
parseMarkdown :: Block -> [Block]
parseMarkdown bl = case bl of
Para [Str str] -> toMarkdown str
Plain [Str str] -> toMarkdown str
_ -> [bl]
where
toMarkdown = either (const [bl]) unPandoc . readMarkdown def
unPandoc (Pandoc _ bls) = bls
*Note that all licence references and agreements mentioned in the servant-pandoc README section above
are relevant to that project's source code only.