diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2012-10-29 22:45:52 -0700 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2013-01-09 09:30:05 -0800 |
commit | d599c4cdabd0d71fd9d27161c949b5e1e692436d (patch) | |
tree | 96b6130be929282f85d0261bbb0e0ef37e4e43ff /man | |
parent | 7a40fa8c08996cb94e7ff3cfafd8ede84972ce70 (diff) |
Added Attr field to Header.
Previously header ids were autogenerated by the writers.
Now they are generated (unless supplied explicitly) in the
markdown parser, if the `header_identifiers` extension is
selected.
In addition, the textile reader now supports id attributes on
headers.
Diffstat (limited to 'man')
-rw-r--r-- | man/make-pandoc-man-pages.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/man/make-pandoc-man-pages.hs b/man/make-pandoc-man-pages.hs index 31a935a28..52e2741f1 100644 --- a/man/make-pandoc-man-pages.hs +++ b/man/make-pandoc-man-pages.hs @@ -55,7 +55,7 @@ removeLinks (Link l _) = l removeLinks x = [x] capitalizeHeaders :: Block -> Block -capitalizeHeaders (Header 1 xs) = Header 1 $ bottomUp capitalize xs +capitalizeHeaders (Header 1 attr xs) = Header 1 attr $ bottomUp capitalize xs capitalizeHeaders x = x capitalize :: Inline -> Inline @@ -63,22 +63,22 @@ capitalize (Str xs) = Str $ map toUpper xs capitalize x = x removeSect :: [Inline] -> [Block] -> [Block] -removeSect ils (Header 1 x:xs) | normalize x == normalize ils = +removeSect ils (Header 1 _ x:xs) | normalize x == normalize ils = dropWhile (not . isHeader1) xs removeSect ils (x:xs) = x : removeSect ils xs removeSect _ [] = [] extractSect :: [Inline] -> [Block] -> [Block] -extractSect ils (Header 1 z:xs) | normalize z == normalize ils = +extractSect ils (Header 1 _ z:xs) | normalize z == normalize ils = bottomUp promoteHeader $ takeWhile (not . isHeader1) xs - where promoteHeader (Header n x) = Header (n-1) x + where promoteHeader (Header n attr x) = Header (n-1) attr x promoteHeader x = x extractSect ils (x:xs) = extractSect ils xs extractSect _ [] = [] isHeader1 :: Block -> Bool -isHeader1 (Header 1 _) = True -isHeader1 _ = False +isHeader1 (Header 1 _ _ ) = True +isHeader1 _ = False -- | Returns a list of 'dependencies' that have been modified after 'file'. |