diff options
author | John MacFarlane <jgm@berkeley.edu> | 2010-07-11 20:03:55 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2010-07-11 20:03:55 -0700 |
commit | cfb27ece34405833592697147276f5bf6418224c (patch) | |
tree | 30b7997e6451e8261661ea3315bb068610a84eff /src/Text | |
parent | 5765ac2523434221cbc29fe45e421cc99d97aa3b (diff) | |
download | pandoc-cfb27ece34405833592697147276f5bf6418224c.tar.gz |
Moved headerShift from pandoc.hs to Shared.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Shared.hs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs index 578ffa94b..babcf3423 100644 --- a/src/Text/Pandoc/Shared.hs +++ b/src/Text/Pandoc/Shared.hs @@ -62,6 +62,7 @@ module Text.Pandoc.Shared ( hierarchicalize, uniqueIdent, isHeaderBlock, + headerShift, -- * Writer options HTMLMathMethod (..), ObfuscationMethod (..), @@ -439,6 +440,13 @@ isHeaderBlock :: Block -> Bool isHeaderBlock (Header _ _) = True isHeaderBlock _ = False +-- | Shift header levels up or down. +headerShift :: Int -> Pandoc -> Pandoc +headerShift n = processWith shift + where shift :: Block -> Block + shift (Header level inner) = Header (level + n) inner + shift x = x + -- -- Writer options -- |