git.iko.soy/typeable/pandoc
on master help sign in
Text.Pandoc.App.Opt: Remove optBaseHeaderLevel from Opt.
fcfdc82John MacFarlane
src/Text/Pandoc/App.hs+1−4
@@ -229,10 +229,7 @@ convertWithOpts opts = do
229 paths -> mapM readFileLazy paths >>= mapM (yamlToMeta readerOpts)
229 paths -> mapM readFileLazy paths >>= mapM (yamlToMeta readerOpts)
230 >>= return . (foldr1 (<>))
230 >>= return . (foldr1 (<>))
231
231
232− let transforms = (case optBaseHeaderLevel opts of
233− x | x > 1 -> (headerShift (x - 1) :)
234− | otherwise -> id) .
235− (case optShiftHeadingLevelBy opts of
232+ let transforms = (case optShiftHeadingLevelBy opts of
236 0 -> id
233 0 -> id
237 x -> (headerShift x :)) .
234 x -> (headerShift x :)) .
238 (if optStripEmptyParagraphs opts
235 (if optStripEmptyParagraphs opts
src/Text/Pandoc/App/CommandLineOptions.hs+1−1
@@ -454,7 +454,7 @@ options =
454 "Use --shift-heading-level-by instead."
454 "Use --shift-heading-level-by instead."
455 case safeRead arg of
455 case safeRead arg of
456 Just t | t > 0 && t < 6 ->
456 Just t | t > 0 && t < 6 ->
457− return opt{ optBaseHeaderLevel = t }
457+ return opt{ optShiftHeadingLevelBy = t - 1 }
458 _ -> E.throwIO $ PandocOptionError
458 _ -> E.throwIO $ PandocOptionError
459 "base-header-level must be 1-5")
459 "base-header-level must be 1-5")
460 "NUMBER")
460 "NUMBER")
src/Text/Pandoc/App/Opt.hs−2
@@ -51,7 +51,6 @@ data Opt = Opt
51 , optWriter :: Maybe String -- ^ Writer format
51 , optWriter :: Maybe String -- ^ Writer format
52 , optTableOfContents :: Bool -- ^ Include table of contents
52 , optTableOfContents :: Bool -- ^ Include table of contents
53 , optShiftHeadingLevelBy :: Int -- ^ Shift heading level by
53 , optShiftHeadingLevelBy :: Int -- ^ Shift heading level by
54− , optBaseHeaderLevel :: Int -- ^ Base header level
55 , optTemplate :: Maybe FilePath -- ^ Custom template
54 , optTemplate :: Maybe FilePath -- ^ Custom template
56 , optVariables :: [(String,String)] -- ^ Template variables to set
55 , optVariables :: [(String,String)] -- ^ Template variables to set
57 , optMetadata :: [(String, String)] -- ^ Metadata fields to set
56 , optMetadata :: [(String, String)] -- ^ Metadata fields to set
@@ -126,7 +125,6 @@ defaultOpts = Opt
126 , optWriter = Nothing
125 , optWriter = Nothing
127 , optTableOfContents = False
126 , optTableOfContents = False
128 , optShiftHeadingLevelBy = 0
127 , optShiftHeadingLevelBy = 0
129− , optBaseHeaderLevel = 1
130 , optTemplate = Nothing
128 , optTemplate = Nothing
131 , optVariables = []
129 , optVariables = []
132 , optMetadata = []
130 , optMetadata = []