on master help sign in
Merge pull request #4557 from gallais/master

[ docs ] definitions in the same order as in the source file

commit51d38884b98f23aaa668ee9b91000c6754f396ad authorNiklas Larsson <metaniklas@gmail.com> dateWed 12 Sep 2018, 14:57 (8 years ago) parent80293baf07ebbf
1 file changed+5−6
src/Idris/IdrisDoc.hs+5−6
src/Idris/IdrisDoc.hs+5−6
@@ -427,13 +427,12 @@ createNsDoc :: IState -- ^ Needed to determine the types of names
427427 -- documentation will be written.
428428 -> IO ()
429429createNsDoc ist ns content out =
430− do let tpath = out </> "docs" </> (genRelNsPath ns "html")
431− dir = takeDirectory tpath
432− file = takeFileName tpath
433− haveDocs (_, Just d, _) = [d]
434− haveDocs _ = []
430+ do let tpath = out </> "docs" </> (genRelNsPath ns "html")
431+ dir = takeDirectory tpath
432+ file = takeFileName tpath
433+ haveDocs (_, md, _) = md
435434 -- We cannot do anything without a Doc
436− content' = concatMap haveDocs (nsContents content)
435+ content' = reverse $ mapMaybe haveDocs $ nsContents content
437436 createDirectoryIfMissing True dir
438437 (path, h) <- openTempFileWithDefaultPermissions dir file
439438 BS2.hPut h $ renderHtml $ wrapper (Just ns) $ do