summaryrefslogtreecommitdiff
path: root/pandoc.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2013-02-23 18:11:05 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2013-02-23 18:11:05 -0800
commit756c8d492a3793a8a0c2b750dac6005885b9a2d0 (patch)
tree9c3d2eaea3b2e8e8d487b7170f732131612abb02 /pandoc.hs
parenta7245b453c433ce4ed585b0097016576090f01cb (diff)
`--number-from` -> `--number-offset`
Also `writerNumberFrom` -> `writeNumberOffset`. The offset is a list of numbers (0 by default). These are added to the section, subsection, etc. numbers that would have been generated automatically.
Diffstat (limited to 'pandoc.hs')
-rw-r--r--pandoc.hs22
1 files changed, 11 insertions, 11 deletions
diff --git a/pandoc.hs b/pandoc.hs
index 2c904984d..c777a3065 100644
--- a/pandoc.hs
+++ b/pandoc.hs
@@ -100,7 +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
+ , optNumberOffset :: [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
@@ -157,7 +157,7 @@ defaultOpts = Opt
, optVariables = []
, optOutputFile = "-" -- "-" means stdout
, optNumberSections = False
- , optNumberFrom = 1
+ , optNumberOffset = [1,1,1,1,1,1]
, optSectionDivs = False
, optIncremental = False
, optSelfContained = False
@@ -469,15 +469,15 @@ options =
(\opt -> return opt { optNumberSections = True }))
"" -- "Number sections in LaTeX"
- , Option "" ["number-from"]
+ , Option "" ["number-offset"]
(ReqArg
(\arg opt ->
- case safeRead arg of
- Just n -> return opt { optNumberFrom = n,
- optNumberSections = True }
- _ -> err 57 "could not parse number-from")
- "NUMBER")
- "" -- "Starting number for sections"
+ case safeRead ('[':arg ++ "]") of
+ Just ns -> return opt { optNumberOffset = ns,
+ optNumberSections = True }
+ _ -> err 57 "could not parse number-offset")
+ "NUMBERS")
+ "" -- "Starting number for sections, subsections, etc."
, Option "" ["no-tex-ligatures"]
(NoArg
@@ -841,7 +841,7 @@ main = do
, optTemplate = templatePath
, optOutputFile = outputFile
, optNumberSections = numberSections
- , optNumberFrom = numberFrom
+ , optNumberOffset = numberFrom
, optSectionDivs = sectionDivs
, optIncremental = incremental
, optSelfContained = selfContained
@@ -1035,7 +1035,7 @@ main = do
writerBiblioFiles = reffiles,
writerIgnoreNotes = False,
writerNumberSections = numberSections,
- writerNumberFrom = numberFrom,
+ writerNumberOffset = numberFrom,
writerSectionDivs = sectionDivs,
writerReferenceLinks = referenceLinks,
writerWrapText = wrap,