diff options
Diffstat (limited to 'pandoc.hs')
-rw-r--r-- | pandoc.hs | 27 |
1 files changed, 14 insertions, 13 deletions
@@ -183,8 +183,7 @@ data Opt = Opt , optHtmlQTags :: Bool -- ^ Use <q> tags in HTML , optHighlight :: Bool -- ^ Highlight source code , optHighlightStyle :: Style -- ^ Style to use for highlighted code - , optChapters :: Bool -- ^ Use chapter for top-level sects - , optParts :: Bool -- ^ Use parts for top-level sects in latex + , optTopLevelDivision :: Division -- ^ Type of the top-level divisions , optHTMLMathMethod :: HTMLMathMethod -- ^ Method to print HTML math , optReferenceODT :: Maybe FilePath -- ^ Path of reference.odt , optReferenceDocx :: Maybe FilePath -- ^ Path of reference.docx @@ -249,8 +248,7 @@ defaultOpts = Opt , optHtmlQTags = False , optHighlight = True , optHighlightStyle = pygments - , optChapters = False - , optParts = False + , optTopLevelDivision = Section , optHTMLMathMethod = PlainMath , optReferenceODT = Nothing , optReferenceDocx = Nothing @@ -608,13 +606,18 @@ options = , Option "" ["chapters"] (NoArg - (\opt -> return opt { optChapters = True })) + (\opt -> do warn $ "--chapters is deprecated. " ++ + "Use --top-level-divison=chapter instead." + return opt { optTopLevelDivision = Chapter })) "" -- "Use chapter for top-level sections in LaTeX, DocBook" - , Option "" ["parts"] - (NoArg - (\opt -> return opt { optParts = True })) - "" -- "Use part for top-level sections in LaTeX" + , Option "" ["top-level-division"] + (ReqArg + (\arg opt -> case safeRead (uppercaseFirstLetter arg) of + Just dvsn -> return opt { optTopLevelDivision = dvsn } + _ -> err 76 "could not parse top-level division") + "[section|chapter|part]") + "" -- "Use top-level division type in LaTeX, ConTeXt, DocBook" , Option "N" ["number-sections"] (NoArg @@ -1129,9 +1132,8 @@ convertWithOpts opts args = do , optHtmlQTags = htmlQTags , optHighlight = highlight , optHighlightStyle = highlightStyle - , optChapters = chapters + , optTopLevelDivision = topLevelDivision , optHTMLMathMethod = mathMethod' - , optParts = parts , optReferenceODT = referenceODT , optReferenceDocx = referenceDocx , optEpubStylesheet = epubStylesheet @@ -1394,8 +1396,7 @@ convertWithOpts opts args = do writerUserDataDir = datadir, writerHtml5 = html5, writerHtmlQTags = htmlQTags, - writerChapters = chapters, - writerParts = parts, + writerTopLevelDivision = topLevelDivision, writerListings = listings, writerBeamer = False, writerSlideLevel = slideLevel, |