@@ -13,9 +13,6 @@ import Network.HTTP.Types
13import Network.Wai
13import Network.Wai
14import Servant
14import Servant
15import Servant.Docs
15import Servant.Docs
16−import Servant.Docs.Pandoc (pandoc)
17−import Text.Pandoc.Options (def, WriterOptions(..))
18−import Text.Pandoc.Writers.HTML (writeHtmlString)
19import qualified GS3
16import qualified GS3
21type DocsAPI = GS3.API :<|> Raw
18type DocsAPI = GS3.API :<|> Raw
@@ -57,38 +54,18 @@ api = Proxy
57docsBS :: ByteString
54docsBS :: ByteString
58docsBS = encodeUtf8
55docsBS = encodeUtf8
60− . writeHtmlString opts
57+ . markdown
62 $ docsWithIntros [intro] GS3.api
58 $ docsWithIntros [intro] GS3.api
64− where opts = def { writerHtml5 = True
65− , writerTableOfContents = True
66− , writerHighlight = True
67− , writerStandalone = True
70− [ "<!DOCTYPE html><html>"
72− , "<meta charset=\"UTF-8\">"
73− , "<title>API Docs - $title$</title>"
83− intro = DocIntro "Welcome" ["This is our super webservice's API.", "Enjoy!"]
60+ where intro = DocIntro "Welcome" ["This is our super webservice's API.", "Enjoy!"]
85server :: Server DocsAPI
62server :: Server DocsAPI
86server = GS3.server :<|> serveDocs
63server = GS3.server :<|> serveDocs
88 where serveDocs _ respond =
65 where serveDocs _ respond =
89− respond $ responseLBS ok200 [html] docsBS
66+ respond $ responseLBS ok200 [plain] docsBS
91− html = ("Content-Type", "text/html")
68+ plain = ("Content-Type", "text/plain")
93app :: Application
70app :: Application
94app = serve api server
71app = serve api server