aboutsummaryrefslogtreecommitdiff
path: root/pandoc.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2013-02-21 21:40:06 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2013-02-21 21:40:06 -0800
commit8df380486c986141ea448e74cdd37e4faae773a1 (patch)
treeb6a86f65fe2f8e52deea6b2f31957eacf7990072 /pandoc.hs
parent07e8cedf2bddcbf13bfd69a415107b2a9aa074aa (diff)
downloadpandoc-8df380486c986141ea448e74cdd37e4faae773a1.tar.gz
Added `--number-from` option and `writerNumberFrom`.
These still aren't hooked up to anything in the writers.
Diffstat (limited to 'pandoc.hs')
-rw-r--r--pandoc.hs13
1 files changed, 13 insertions, 0 deletions
diff --git a/pandoc.hs b/pandoc.hs
index 203dcf882..1c984f681 100644
--- a/pandoc.hs
+++ b/pandoc.hs
@@ -100,6 +100,7 @@ data Opt = Opt
, optVariables :: [(String,String)] -- ^ Template variables to set
, optOutputFile :: String -- ^ Name of output file
, optNumberSections :: Bool -- ^ Number sections in LaTeX
+ , optNumberFrom :: Int -- ^ Starting number for sections
, optSectionDivs :: Bool -- ^ Put sections in div tags in HTML
, optIncremental :: Bool -- ^ Use incremental lists in Slidy/Slideous/S5
, optSelfContained :: Bool -- ^ Make HTML accessible offline
@@ -156,6 +157,7 @@ defaultOpts = Opt
, optVariables = []
, optOutputFile = "-" -- "-" means stdout
, optNumberSections = False
+ , optNumberFrom = 1
, optSectionDivs = False
, optIncremental = False
, optSelfContained = False
@@ -467,6 +469,15 @@ options =
(\opt -> return opt { optNumberSections = True }))
"" -- "Number sections in LaTeX"
+ , Option "" ["number-from"]
+ (ReqArg
+ (\arg opt ->
+ case safeRead arg of
+ Just n -> return opt { optNumberFrom = n }
+ _ -> err 57 "could not parse number-from")
+ "NUMBER")
+ "" -- "Starting number for sections"
+
, Option "" ["no-tex-ligatures"]
(NoArg
(\opt -> return opt { optTeXLigatures = False }))
@@ -829,6 +840,7 @@ main = do
, optTemplate = templatePath
, optOutputFile = outputFile
, optNumberSections = numberSections
+ , optNumberFrom = numberFrom
, optSectionDivs = sectionDivs
, optIncremental = incremental
, optSelfContained = selfContained
@@ -1022,6 +1034,7 @@ main = do
writerBiblioFiles = reffiles,
writerIgnoreNotes = False,
writerNumberSections = numberSections,
+ writerNumberFrom = numberFrom,
writerSectionDivs = sectionDivs,
writerReferenceLinks = referenceLinks,
writerWrapText = wrap,