aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/App/Opt.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-09-10 23:16:13 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2019-09-10 23:16:13 -0700
commit88dc6fac5d2d6f494e9c334261ecb40d3e156667 (patch)
treeb4786323d43f44433a41bddc5b85433af34bfcb4 /src/Text/Pandoc/App/Opt.hs
parenta64b3ab61ff34dca25f04f4f97b283dc5159ac87 (diff)
downloadpandoc-88dc6fac5d2d6f494e9c334261ecb40d3e156667.tar.gz
Add --shift-heading-level-by option.
Deprecate --base-heading-level. The new option does everything the old one does, but also allows negative shifts. It also promotes the document metadata (if not null) to a level-1 heading with a +1 shift, and demotes an initial level-1 heading to document metadata with a -1 shift. This supports converting documents that use an initial level-1 heading for the document title. Closes #5615.
Diffstat (limited to 'src/Text/Pandoc/App/Opt.hs')
-rw-r--r--src/Text/Pandoc/App/Opt.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Text/Pandoc/App/Opt.hs b/src/Text/Pandoc/App/Opt.hs
index 0b7bb7f2c..1111a5457 100644
--- a/src/Text/Pandoc/App/Opt.hs
+++ b/src/Text/Pandoc/App/Opt.hs
@@ -50,6 +50,7 @@ data Opt = Opt
, optReader :: Maybe String -- ^ Reader format
, optWriter :: Maybe String -- ^ Writer format
, optTableOfContents :: Bool -- ^ Include table of contents
+ , optShiftHeadingLevel :: Int -- ^ Shift heading level by
, optBaseHeaderLevel :: Int -- ^ Base header level
, optTemplate :: Maybe FilePath -- ^ Custom template
, optVariables :: [(String,String)] -- ^ Template variables to set
@@ -124,6 +125,7 @@ defaultOpts = Opt
, optReader = Nothing
, optWriter = Nothing
, optTableOfContents = False
+ , optShiftHeadingLevel = 0
, optBaseHeaderLevel = 1
, optTemplate = Nothing
, optVariables = []