Added --atx-headers option.
This commit is contained in:
parent
1ce7c38bc4
commit
5fc6669be6
3 changed files with 17 additions and 1 deletions
4
README
4
README
|
@ -342,6 +342,10 @@ Options affecting specific writers
|
|||
: Use reference-style links, rather than inline links, in writing markdown
|
||||
or reStructuredText. By default inline links are used.
|
||||
|
||||
`--atx-headers`
|
||||
: Use ATX style headers in markdown output. The default is to use
|
||||
setext-style headers for levels 1-2, and then ATX headers.
|
||||
|
||||
`--chapters`
|
||||
: Treat top-level headers as chapters in LaTeX, ConTeXt, and DocBook
|
||||
output. When the LaTeX template uses the report, book, or
|
||||
|
|
|
@ -483,6 +483,7 @@ data WriterOptions = WriterOptions
|
|||
, writerListings :: Bool -- ^ Use listings package for code
|
||||
, writerHighlight :: Bool -- ^ Highlight source code
|
||||
, writerHighlightStyle :: Style -- ^ Style to use for highlighting
|
||||
, writerSetextHeaders :: Bool -- ^ Use setext headers for levels 1-2 in markdown
|
||||
} deriving Show
|
||||
|
||||
{-# DEPRECATED writerXeTeX "writerXeTeX no longer does anything" #-}
|
||||
|
@ -520,6 +521,7 @@ defaultWriterOptions =
|
|||
, writerListings = False
|
||||
, writerHighlight = False
|
||||
, writerHighlightStyle = pygments
|
||||
, writerSetextHeaders = True
|
||||
}
|
||||
|
||||
--
|
||||
|
|
|
@ -132,6 +132,7 @@ data Opt = Opt
|
|||
, optLaTeXEngine :: String -- ^ Program to use for latex -> pdf
|
||||
, optBeamer :: Bool -- ^ Produce latex output for beamer class
|
||||
, optSlideLevel :: Maybe Int -- ^ Header level that creates slides
|
||||
, optSetextHeaders :: Bool -- ^ Use atx headers for markdown level 1-2
|
||||
}
|
||||
|
||||
-- | Defaults for command-line options.
|
||||
|
@ -182,6 +183,7 @@ defaultOpts = Opt
|
|||
, optLaTeXEngine = "pdflatex"
|
||||
, optBeamer = False
|
||||
, optSlideLevel = Nothing
|
||||
, optSetextHeaders = True
|
||||
}
|
||||
|
||||
-- | A list of functions, each transforming the options data structure
|
||||
|
@ -414,6 +416,11 @@ options =
|
|||
(\opt -> return opt { optReferenceLinks = True } ))
|
||||
"" -- "Use reference links in parsing HTML"
|
||||
|
||||
, Option "" ["atx-headers"]
|
||||
(NoArg
|
||||
(\opt -> return opt { optSetextHeaders = False } ))
|
||||
"" -- "Use atx-style headers for markdown"
|
||||
|
||||
, Option "" ["chapters"]
|
||||
(NoArg
|
||||
(\opt -> return opt { optChapters = True }))
|
||||
|
@ -810,6 +817,7 @@ main = do
|
|||
, optLaTeXEngine = latexEngine
|
||||
, optBeamer = beamer
|
||||
, optSlideLevel = slideLevel
|
||||
, optSetextHeaders = setextHeaders
|
||||
} = opts
|
||||
|
||||
when dumpArgs $
|
||||
|
@ -960,7 +968,9 @@ main = do
|
|||
writerBeamer = beamer,
|
||||
writerSlideLevel = slideLevel,
|
||||
writerHighlight = highlight,
|
||||
writerHighlightStyle = highlightStyle }
|
||||
writerHighlightStyle = highlightStyle,
|
||||
writerSetextHeaders = setextHeaders
|
||||
}
|
||||
|
||||
when (writerName' `elem` nonTextFormats&& outputFile == "-") $
|
||||
err 5 $ "Cannot write " ++ writerName' ++ " output to stdout.\n" ++
|
||||
|
|
Loading…
Add table
Reference in a new issue