on master help sign in
A better name for ApiOptions

It's more about how rendering happens than options for the API.

commita6936480449bb22ed0c8aca6a54f4f5d1ebb6b95 authorIvan Lazar Miljenovic <Ivan.Miljenovic@gmail.com> dateFri 6 Oct 2017, 10:59 (9 years ago) parente3c1c2b
2 files changed+8−8
servant-docs/src/Servant/Docs.hs+1−1 servant-docs/src/Servant/Docs/Internal.hs+7−7
servant-docs/src/Servant/Docs.hs+1−1
@@ -25,7 +25,7 @@ module Servant.Docs
2525 ( -- * 'HasDocs' class and key functions
2626 HasDocs(..), docs, pretty, markdown
2727 -- ** Customising generated documentation
28− , markdownWith, ApiOptions(..), defApiOptions
28+ , markdownWith, RenderingOptions(..), defRenderingOptions
2929 , requestExamples, responseExamples, ShowContentTypes(..)
3030 -- * Generating docs with extra information
3131 , docsWith, docsWithIntros, docsWithOptions
servant-docs/src/Servant/Docs/Internal.hs+7−7
@@ -303,14 +303,14 @@ data ShowContentTypes = AllContentTypes | FirstContentType
303303 deriving (Eq, Ord, Show, Read, Bounded, Enum)
304304
305305-- | Customise how an 'API' is converted into documentation.
306−data ApiOptions = ApiOptions
306+data RenderingOptions = RenderingOptions
307307 { _requestExamples :: !ShowContentTypes
308308 , _responseExamples :: !ShowContentTypes
309309 } deriving (Show)
310310
311311-- | Default API generation options.
312−defApiOptions :: ApiOptions
313−defApiOptions = ApiOptions
312+defRenderingOptions :: RenderingOptions
313+defRenderingOptions = RenderingOptions
314314 { _requestExamples = AllContentTypes
315315 , _responseExamples = AllContentTypes
316316 }
@@ -326,7 +326,7 @@ makeLenses ''DocIntro
326326makeLenses ''DocNote
327327makeLenses ''Response
328328makeLenses ''Action
329−makeLenses ''ApiOptions
329+makeLenses ''RenderingOptions
330330
331331-- | Generate the docs for a given API that implements 'HasDocs'. This is the
332332-- default way to create documentation.
@@ -543,10 +543,10 @@ class ToAuthInfo a where
543543-- | Generate documentation in Markdown format for
544544-- the given 'API'.
545545markdown :: API -> String
546−markdown = markdownWith defApiOptions
546+markdown = markdownWith defRenderingOptions
547547
548−markdownWith :: ApiOptions -> API -> String
549−markdownWith ApiOptions{..} api = unlines $
548+markdownWith :: RenderingOptions -> API -> String
549+markdownWith RenderingOptions{..} api = unlines $
550550 introsStr (api ^. apiIntros)
551551 ++ (concatMap (uncurry printEndpoint) . sort . HM.toList $ api ^. apiEndpoints)
552552