mirror of
https://github.com/jgm/pandoc.git
synced 2026-10-24 01:07:21 +08:00
Added --number-from option and writerNumberFrom.
These still aren't hooked up to anything in the writers.
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -270,6 +270,7 @@ data WriterOptions = WriterOptions
|
||||
, writerHTMLMathMethod :: HTMLMathMethod -- ^ How to print math in HTML
|
||||
, writerIgnoreNotes :: Bool -- ^ Ignore footnotes (used in making toc)
|
||||
, writerNumberSections :: Bool -- ^ Number sections in LaTeX
|
||||
, writerNumberFrom :: Int -- ^ Starting section number
|
||||
, writerSectionDivs :: Bool -- ^ Put sections in div tags in HTML
|
||||
, writerExtensions :: Set Extension -- ^ Markdown extensions that can be used
|
||||
, writerReferenceLinks :: Bool -- ^ Use reference links in writing markdown, rst
|
||||
@@ -313,6 +314,7 @@ instance Default WriterOptions where
|
||||
, writerHTMLMathMethod = PlainMath
|
||||
, writerIgnoreNotes = False
|
||||
, writerNumberSections = False
|
||||
, writerNumberFrom = 1
|
||||
, writerSectionDivs = False
|
||||
, writerExtensions = pandocExtensions
|
||||
, writerReferenceLinks = False
|
||||
|
||||
Reference in New Issue
Block a user