diff options
author | John MacFarlane <jgm@berkeley.edu> | 2011-01-11 20:23:43 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2011-01-11 20:23:43 -0800 |
commit | 33ff2fed2171fb8b8267e9fff5fbff27d047dd96 (patch) | |
tree | 638182fd41a24089ba25d199cd6ad66bab0835b7 | |
parent | bda1032f66239bbb83270f015c7fe956f000f190 (diff) | |
download | pandoc-33ff2fed2171fb8b8267e9fff5fbff27d047dd96.tar.gz |
Text.Pandoc: Improved readers, writers lists for lhs variants.
Now the lhs variants set the needed literate Haskell flag in
parser state and writer options.
-rw-r--r-- | src/Text/Pandoc.hs | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/Text/Pandoc.hs b/src/Text/Pandoc.hs index c752ffede..3532c1d4b 100644 --- a/src/Text/Pandoc.hs +++ b/src/Text/Pandoc.hs @@ -146,13 +146,15 @@ readers :: [(String, ParserState -> String -> Pandoc)] readers = [("native" , \_ -> read) ,("json" , \_ -> decodeJSON) ,("markdown" , readMarkdown) - ,("markdown+lhs" , readMarkdown) + ,("markdown+lhs" , \st -> + readMarkdown st{ stateLiterateHaskell = True}) ,("rst" , readRST) ,("textile" , readTextile) -- TODO : textile+lhs ,("rst+lhs" , readRST) ,("html" , readHtml) ,("latex" , readLaTeX) - ,("latex+lhs" , readLaTeX) + ,("latex+lhs" , \st -> + readLaTeX st{ stateLiterateHaskell = True}) ] -- | Association list of formats and writers (omitting the @@ -161,21 +163,25 @@ writers :: [ ( String, WriterOptions -> Pandoc -> String ) ] writers = [("native" , writeNative) ,("json" , \_ -> encodeJSON) ,("html" , writeHtmlString) - ,("html+lhs" , writeHtmlString) + ,("html+lhs" , \o -> + writeHtmlString o{ writerLiterateHaskell = True }) ,("s5" , writeHtmlString) ,("slidy" , writeHtmlString) ,("docbook" , writeDocbook) ,("opendocument" , writeOpenDocument) ,("latex" , writeLaTeX) - ,("latex+lhs" , writeLaTeX) + ,("latex+lhs" , \o -> + writeLaTeX o{ writerLiterateHaskell = True }) ,("context" , writeConTeXt) ,("texinfo" , writeTexinfo) ,("man" , writeMan) ,("markdown" , writeMarkdown) - ,("markdown+lhs" , writeMarkdown) + ,("markdown+lhs" , \o -> + writeMarkdown o{ writerLiterateHaskell = True }) ,("plain" , writePlain) ,("rst" , writeRST) - ,("rst+lhs" , writeRST) + ,("rst+lhs" , \o -> + writeRST o{ writerLiterateHaskell = True }) ,("mediawiki" , writeMediaWiki) ,("textile" , writeTextile) ,("rtf" , writeRTF) |