module Text.Pandoc
(
module Text.Pandoc.Definition
, module Text.Pandoc.Generic
, readers
, writers
, readMarkdown
, readRST
, readLaTeX
, readHtml
, readTextile
, readNative
, ParserState (..)
, defaultParserState
, ParserContext (..)
, QuoteContext (..)
, KeyTable
, NoteTable
, HeaderType (..)
, writeNative
, writeMarkdown
, writePlain
, writeRST
, writeLaTeX
, writeConTeXt
, writeTexinfo
, writeHtml
, writeHtmlString
, writeDocbook
, writeOpenDocument
, writeMan
, writeMediaWiki
, writeTextile
, writeRTF
, writeODT
, writeEPUB
, writeOrg
, WriterOptions (..)
, HTMLSlideVariant (..)
, HTMLMathMethod (..)
, CiteMethod (..)
, defaultWriterOptions
, module Text.Pandoc.Templates
, pandocVersion
, rtfEmbedImage
, jsonFilter
) where
import Text.Pandoc.Definition
import Text.Pandoc.Generic
import Text.Pandoc.Readers.Markdown
import Text.Pandoc.Readers.RST
import Text.Pandoc.Readers.LaTeX
import Text.Pandoc.Readers.HTML
import Text.Pandoc.Readers.Textile
import Text.Pandoc.Readers.Native
import Text.Pandoc.Writers.Native
import Text.Pandoc.Writers.Markdown
import Text.Pandoc.Writers.RST
import Text.Pandoc.Writers.LaTeX
import Text.Pandoc.Writers.ConTeXt
import Text.Pandoc.Writers.Texinfo
import Text.Pandoc.Writers.HTML
import Text.Pandoc.Writers.ODT
import Text.Pandoc.Writers.EPUB
import Text.Pandoc.Writers.Docbook
import Text.Pandoc.Writers.OpenDocument
import Text.Pandoc.Writers.Man
import Text.Pandoc.Writers.RTF
import Text.Pandoc.Writers.MediaWiki
import Text.Pandoc.Writers.Textile
import Text.Pandoc.Writers.Org
import Text.Pandoc.Templates
import Text.Pandoc.Parsing
import Text.Pandoc.Shared
import Data.Version (showVersion)
import Text.JSON.Generic
import Paths_pandoc (version)
pandocVersion :: String
pandocVersion = showVersion version
readers :: [(String, ParserState -> String -> Pandoc)]
readers = [("native" , \_ -> readNative)
,("json" , \_ -> decodeJSON)
,("markdown" , readMarkdown)
,("markdown+lhs" , \st ->
readMarkdown st{ stateLiterateHaskell = True})
,("rst" , readRST)
,("rst+lhs" , \st ->
readRST st{ stateLiterateHaskell = True})
,("textile" , readTextile)
,("html" , readHtml)
,("latex" , readLaTeX)
,("latex+lhs" , \st ->
readLaTeX st{ stateLiterateHaskell = True})
]
writers :: [ ( String, WriterOptions -> Pandoc -> String ) ]
writers = [("native" , writeNative)
,("json" , \_ -> encodeJSON)
,("html" , writeHtmlString)
,("html+lhs" , \o ->
writeHtmlString o{ writerLiterateHaskell = True })
,("s5" , writeHtmlString)
,("slidy" , writeHtmlString)
,("docbook" , writeDocbook)
,("opendocument" , writeOpenDocument)
,("latex" , writeLaTeX)
,("latex+lhs" , \o ->
writeLaTeX o{ writerLiterateHaskell = True })
,("context" , writeConTeXt)
,("texinfo" , writeTexinfo)
,("man" , writeMan)
,("markdown" , writeMarkdown)
,("markdown+lhs" , \o ->
writeMarkdown o{ writerLiterateHaskell = True })
,("plain" , writePlain)
,("rst" , writeRST)
,("rst+lhs" , \o ->
writeRST o{ writerLiterateHaskell = True })
,("mediawiki" , writeMediaWiki)
,("textile" , writeTextile)
,("rtf" , writeRTF)
,("org" , writeOrg)
]
jsonFilter :: (Pandoc -> Pandoc) -> String -> String
jsonFilter f = encodeJSON . f . decodeJSON