aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2010-07-11 20:03:55 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2010-07-11 20:03:55 -0700
commitcfb27ece34405833592697147276f5bf6418224c (patch)
tree30b7997e6451e8261661ea3315bb068610a84eff /src/Text
parent5765ac2523434221cbc29fe45e421cc99d97aa3b (diff)
downloadpandoc-cfb27ece34405833592697147276f5bf6418224c.tar.gz
Moved headerShift from pandoc.hs to Shared.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Shared.hs8
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
--