summaryrefslogtreecommitdiff
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
parent5765ac2523434221cbc29fe45e421cc99d97aa3b (diff)
Moved headerShift from pandoc.hs to Shared.
-rw-r--r--src/Text/Pandoc/Shared.hs8
-rw-r--r--src/pandoc.hs9
2 files changed, 10 insertions, 7 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
--
diff --git a/src/pandoc.hs b/src/pandoc.hs
index bfb619f04..a2be60d52 100644
--- a/src/pandoc.hs
+++ b/src/pandoc.hs
@@ -31,7 +31,8 @@ writers.
module Main where
import Text.Pandoc
import Text.Pandoc.Writers.S5 (s5HeaderIncludes)
-import Text.Pandoc.Shared ( tabFilter, ObfuscationMethod (..), readDataFile )
+import Text.Pandoc.Shared ( tabFilter, ObfuscationMethod (..), readDataFile,
+ headerShift )
#ifdef _HIGHLIGHTING
import Text.Pandoc.Highlighting ( languages )
#endif
@@ -127,12 +128,6 @@ writers = [("native" , writeNative)
isNonTextOutput :: String -> Bool
isNonTextOutput = (`elem` ["odt","epub"])
-headerShift :: Int -> Pandoc -> Pandoc
-headerShift n = processWith shift
- where shift :: Block -> Block
- shift (Header level inner) = Header (level + n) inner
- shift x = x
-
-- | Data structure for command line options.
data Opt = Opt
{ optTabStop :: Int -- ^ Number of spaces per tab