@@ -43,8 +43,7 @@ inline links:
4343>
4444> markdownToRST :: String -> String
4545> markdownToRST =
46−> (writeRST defaultWriterOptions {writerReferenceLinks = True}) .
47−> readMarkdown defaultParserState
46+> (writeRST def {writerReferenceLinks = True}) . readMarkdown def
4847>
4948> main = getContents >>= putStrLn . markdownToRST
5049
@@ -73,14 +72,6 @@ module Text.Pandoc
7372 , readTextile
7473 , readDocBook
7574 , readNative
76− -- * Parser state used in readers
77− , ParserState (..)
78− , defaultParserState
79− , ParserContext (..)
80− , QuoteContext (..)
81− , KeyTable
82− , NoteTable
83− , HeaderType (..)
8475 -- * Writers: converting /from/ Pandoc format
8576 , Writer (..)
8677 , writeNative
@@ -118,8 +109,6 @@ module Text.Pandoc
118109 , rtfEmbedImage
119110 , jsonFilter
120111 , ToJsonFilter(..)
121− -- * From Data.Default
122− , def
123112 ) where
124113
125114import Text.Pandoc.Definition
@@ -151,41 +140,33 @@ import Text.Pandoc.Writers.Textile
151140import Text.Pandoc.Writers.Org
152141import Text.Pandoc.Writers.AsciiDoc
153142import Text.Pandoc.Templates
154−import Text.Pandoc.Parsing
155143import Text.Pandoc.Shared
156144import Text.Pandoc.Options
157145import Data.ByteString.Lazy (ByteString)
158146import Data.Version (showVersion)
159147import Text.JSON.Generic
160148import Paths_pandoc (version)
161−import Data.Default
162149
163150-- | Version number of pandoc library.
164151pandocVersion :: String
165152pandocVersion = showVersion version
166153
167154-- | Association list of formats and readers.
168−readers :: [(String, ParserState -> String -> Pandoc)]
155+readers :: [(String, ReaderOptions -> String -> Pandoc)]
169156readers = [("native" , \_ -> readNative)
170157 ,("json" , \_ -> decodeJSON)
171158 ,("markdown" , readMarkdown)
172− ,("markdown+lhs" , \st ->
173− readMarkdown st{ stateOptions =
174− let oldopts = stateOptions st
175− in oldopts{ readerLiterateHaskell = True} })
159+ ,("markdown+lhs" , \opt ->
160+ readMarkdown opt{ readerLiterateHaskell = True })
176161 ,("rst" , readRST)
177− ,("rst+lhs" , \st ->
178− readRST st{ stateOptions =
179− let oldopts = stateOptions st
180− in oldopts{ readerLiterateHaskell = True} })
162+ ,("rst+lhs" , \opt ->
163+ readRST opt{ readerLiterateHaskell = True })
181164 ,("docbook" , readDocBook)
182165 ,("textile" , readTextile) -- TODO : textile+lhs
183166 ,("html" , readHtml)
184167 ,("latex" , readLaTeX)
185− ,("latex+lhs" , \st ->
186− readLaTeX st{ stateOptions =
187− let oldopts = stateOptions st
188− in oldopts{ readerLiterateHaskell = True} })
168+ ,("latex+lhs" , \opt ->
169+ readLaTeX opt{ readerLiterateHaskell = True })
189170 ]
190171
191172data Writer = PureStringWriter (WriterOptions -> Pandoc -> String)