diff options
author | Mateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk> | 2013-09-03 01:29:27 +0100 |
---|---|---|
committer | Austin Seipp <austin@well-typed.com> | 2014-01-12 14:48:35 -0600 |
commit | b11f371fdc9197cb45a6dafbcc0b095273d6614f (patch) | |
tree | 47dcee8f16e17903dfa059ed9236f276d6cdf1b0 /src/Haddock/InterfaceFile.hs | |
parent | ef9aa98d6ccbe79888c501f94c9aa6688520c28e (diff) |
Allow for headings inside function documentation.
LaTeX will treat the h3-h6 headings the same as we'd have to hack the
style file heavily otherwise and it would make the headings tiny
anyway.
Hoogle upstream said they will put in the functionality on their end.
Conflicts:
src/Haddock/Interface/Rename.hs
src/Haddock/Types.hs
test/Haddock/ParserSpec.hs
Diffstat (limited to 'src/Haddock/InterfaceFile.hs')
-rw-r--r-- | src/Haddock/InterfaceFile.hs | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/Haddock/InterfaceFile.hs b/src/Haddock/InterfaceFile.hs index 3024f212..6bf22c9b 100644 --- a/src/Haddock/InterfaceFile.hs +++ b/src/Haddock/InterfaceFile.hs @@ -437,7 +437,14 @@ instance Binary Picture where title <- get bh return (Picture uri title) - +instance Binary a => Binary (Header a) where + put_ bh (Header l t) = do + put_ bh l + put_ bh t + get bh = do + l <- get bh + t <- get bh + return (Header l t) {-* Generated by DrIFT : Look, but Don't Touch. *-} instance (Binary id) => Binary (Doc id) where @@ -501,6 +508,10 @@ instance (Binary id) => Binary (Doc id) where put_ bh (DocBold x) = do putByte bh 19 put_ bh x + put_ bh (DocHeader aa) = do + putByte bh 20 + put_ bh aa + get bh = do h <- getByte bh case h of @@ -564,7 +575,10 @@ instance (Binary id) => Binary (Doc id) where 19 -> do x <- get bh return (DocBold x) - _ -> fail "invalid binary data found" + 20 -> do + aa <- get bh + return (DocHeader aa) + _ -> error "invalid binary data found in the interface file" instance Binary name => Binary (HaddockModInfo name) where |