Moved isHeaderBlock from Text.Pandoc.Writers.HTML
to Text.Pandoc.Shared. git-svn-id: https://pandoc.googlecode.com/svn/trunk@656 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
parent
2d4a22d0be
commit
489a2bb1d9
2 changed files with 6 additions and 5 deletions
|
@ -63,6 +63,7 @@ module Text.Pandoc.Shared (
|
||||||
compactify,
|
compactify,
|
||||||
Element (..),
|
Element (..),
|
||||||
hierarchicalize,
|
hierarchicalize,
|
||||||
|
isHeaderBlock,
|
||||||
-- * Writer options
|
-- * Writer options
|
||||||
WriterOptions (..),
|
WriterOptions (..),
|
||||||
defaultWriterOptions,
|
defaultWriterOptions,
|
||||||
|
@ -390,6 +391,11 @@ hierarchicalize (block:rest) =
|
||||||
(hierarchicalize rest')
|
(hierarchicalize rest')
|
||||||
x -> (Blk x):(hierarchicalize rest)
|
x -> (Blk x):(hierarchicalize rest)
|
||||||
|
|
||||||
|
-- | True if block is a Header block.
|
||||||
|
isHeaderBlock :: Block -> Bool
|
||||||
|
isHeaderBlock (Header _ _) = True
|
||||||
|
isHeaderBlock _ = False
|
||||||
|
|
||||||
-- | Options for writers
|
-- | Options for writers
|
||||||
data WriterOptions = WriterOptions
|
data WriterOptions = WriterOptions
|
||||||
{ writerStandalone :: Bool -- ^ Include header and footer
|
{ writerStandalone :: Bool -- ^ Include header and footer
|
||||||
|
|
|
@ -87,11 +87,6 @@ writeHtml opts (Pandoc (Meta tit authors date) blocks) =
|
||||||
then head +++ (body thebody)
|
then head +++ (body thebody)
|
||||||
else thebody
|
else thebody
|
||||||
|
|
||||||
-- | True if block is a Header block.
|
|
||||||
isHeaderBlock :: Block -> Bool
|
|
||||||
isHeaderBlock (Header _ _) = True
|
|
||||||
isHeaderBlock _ = False
|
|
||||||
|
|
||||||
-- | Construct table of contents from list of header blocks and identifiers.
|
-- | Construct table of contents from list of header blocks and identifiers.
|
||||||
-- Assumes there are as many identifiers as header blocks.
|
-- Assumes there are as many identifiers as header blocks.
|
||||||
tableOfContents :: WriterOptions -> [Block] -> Ids -> Html
|
tableOfContents :: WriterOptions -> [Block] -> Ids -> Html
|
||||||
|
|
Loading…
Reference in a new issue