git.iko.soy/typeable/pandoc
on master help sign in
Moved isHeaderBlock from Text.Pandoc.Writers.HTML
489a2bbfiddlosopher
src/Text/Pandoc/Shared.hs+6
@@ -63,6 +63,7 @@ module Text.Pandoc.Shared (
63 compactify,
63 compactify,
64 Element (..),
64 Element (..),
65 hierarchicalize,
65 hierarchicalize,
66+ isHeaderBlock,
66 -- * Writer options
67 -- * Writer options
67 WriterOptions (..),
68 WriterOptions (..),
68 defaultWriterOptions,
69 defaultWriterOptions,
@@ -390,6 +391,11 @@ hierarchicalize (block:rest) =
390 (hierarchicalize rest')
391 (hierarchicalize rest')
391 x -> (Blk x):(hierarchicalize rest)
392 x -> (Blk x):(hierarchicalize rest)
392
393
394+-- | True if block is a Header block.
395+isHeaderBlock :: Block -> Bool
396+isHeaderBlock (Header _ _) = True
397+isHeaderBlock _ = False
398+
393-- | Options for writers
399-- | Options for writers
394data WriterOptions = WriterOptions
400data WriterOptions = WriterOptions
395 { writerStandalone :: Bool -- ^ Include header and footer
401 { writerStandalone :: Bool -- ^ Include header and footer
src/Text/Pandoc/Writers/HTML.hs−5
@@ -87,11 +87,6 @@ writeHtml opts (Pandoc (Meta tit authors date) blocks) =
87 then head +++ (body thebody)
87 then head +++ (body thebody)
88 else thebody
88 else thebody
89
89
90−-- | True if block is a Header block.
91−isHeaderBlock :: Block -> Bool
92−isHeaderBlock (Header _ _) = True
93−isHeaderBlock _ = False
94−
95-- | Construct table of contents from list of header blocks and identifiers.
90-- | Construct table of contents from list of header blocks and identifiers.
96-- Assumes there are as many identifiers as header blocks.
91-- Assumes there are as many identifiers as header blocks.
97tableOfContents :: WriterOptions -> [Block] -> Ids -> Html
92tableOfContents :: WriterOptions -> [Block] -> Ids -> Html