@@ -313,18 +313,22 @@ data RenderingOptions = RenderingOptions
313 -- ^ How many content types to display for request body examples?
313 -- ^ How many content types to display for request body examples?
314 , _responseExamples :: !ShowContentTypes
314 , _responseExamples :: !ShowContentTypes
315 -- ^ How many content types to display for response body examples?
315 -- ^ How many content types to display for response body examples?
316+ , _notesHeading :: !(Maybe String)
317+ -- ^ Optionally group all 'notes' together under a common heading.
316 } deriving (Show)
318 } deriving (Show)
318-- | Default API generation options.
320-- | Default API generation options.
320-- All content types are shown for both 'requestExamples' and
322-- All content types are shown for both 'requestExamples' and
321−-- 'responseExamples'.
323+-- 'responseExamples'; 'notesHeading' is set to 'Nothing'
324+-- (i.e. un-grouped).
323-- @since 0.11.1
326-- @since 0.11.1
324defRenderingOptions :: RenderingOptions
327defRenderingOptions :: RenderingOptions
325defRenderingOptions = RenderingOptions
328defRenderingOptions = RenderingOptions
326 { _requestExamples = AllContentTypes
329 { _requestExamples = AllContentTypes
327 , _responseExamples = AllContentTypes
330 , _responseExamples = AllContentTypes
331+ , _notesHeading = Nothing
330-- gimme some lenses
334-- gimme some lenses
@@ -615,16 +619,21 @@ markdownWith RenderingOptions{..} api = unlines $
617 notesStr :: [DocNote] -> [String]
621 notesStr :: [DocNote] -> [String]
622+ notesStr = addHeading
618− notesStr = concatMap noteStr
623+ . concatMap noteStr
625+ addHeading nts = maybe nts (\hd -> ("### " ++ hd) : "" : nts) _notesHeading
620 noteStr :: DocNote -> [String]
627 noteStr :: DocNote -> [String]
621 noteStr nt =
628 noteStr nt =
622− ("### " ++ nt ^. noteTitle) :
629+ (hdr ++ nt ^. noteTitle) :
624 intersperse "" (nt ^. noteBody) ++
631 intersperse "" (nt ^. noteBody) ++
635+ hdr | isJust _notesHeading = "#### "
636+ | otherwise = "### "
629 authStr :: [DocAuthentication] -> [String]
638 authStr :: [DocAuthentication] -> [String]
630 authStr [] = []
639 authStr [] = []