-- | Module exporting pandoc bindings--moduleHakyll.Web.Pandoc(-- * The basic building blocksreadPandoc,readPandocWith,writePandoc,writePandocWith-- * Functions working on pages/compilers,pageReadPandoc,pageReadPandocWith,pageReadPandocWithA,pageRenderPandoc,pageRenderPandocWith-- * Default options,defaultHakyllParserState,defaultHakyllWriterOptions)whereimportPreludehiding(id)importControl.Applicative((<$>))importControl.Arrow((>>>),(>>^),(&&&),(***))importControl.Category(id)importData.Maybe(fromMaybe)importText.PandocimportHakyll.Core.CompilerimportHakyll.Core.IdentifierimportHakyll.Core.Util.ArrowimportHakyll.Web.Pandoc.FileTypeimportHakyll.Web.Page.Internal-- | Read a string using pandoc, with the default options--readPandoc::FileType-- ^ Determines how parsing happens->Maybe(Identifiera)-- ^ Optional, for better error messages->String-- ^ String to read->Pandoc-- ^ Resulting documentreadPandoc=readPandocWithdefaultHakyllParserState-- | Read a string using pandoc, with the supplied options--readPandocWith::ParserState-- ^ Parser options->FileType-- ^ Determines parsing method->Maybe(Identifiera)-- ^ Optional, for better error messages->String-- ^ String to read->Pandoc-- ^ Resulting documentreadPandocWithstatefileType'id'=casefileType'ofHtml->readHtmlstateLaTeX->readLaTeXstateLiterateHaskellt->readPandocWithstate{stateLiterateHaskell=True}tid'Markdown->readMarkdownstateRst->readRSTstatet->error$"Hakyll.Web.readPandocWith: I don't know how to read a file of the "++"type "++showt++fromMaybe""(fmap((" for: "++).show)id')-- | Write a document (as HTML) using pandoc, with the default options--writePandoc::Pandoc-- ^ Document to write->String-- ^ Resulting HTMLwritePandoc=writePandocWithdefaultHakyllWriterOptions-- | Write a document (as HTML) using pandoc, with the supplied options--writePandocWith::WriterOptions-- ^ Writer options for pandoc->Pandoc-- ^ Document to write->String-- ^ Resulting HTMLwritePandocWith=writeHtmlString-- | Read the resource using pandoc--pageReadPandoc::Compiler(PageString)(PagePandoc)pageReadPandoc=pageReadPandocWithdefaultHakyllParserState-- | Read the resource using pandoc--pageReadPandocWith::ParserState->Compiler(PageString)(PagePandoc)pageReadPandocWithstate=constAstate&&&id>>>pageReadPandocWithA-- | Read the resource using pandoc. This is a (rarely needed) variant, which-- comes in very useful when the parser state is the result of some arrow.--pageReadPandocWithA::Compiler(ParserState,PageString)(PagePandoc)pageReadPandocWithA=id***id&&&getIdentifier&&&getFileType>>^pageReadPandocWithA'wherepageReadPandocWithA'(s,(p,(i,t)))=readPandocWithst(Justi)<$>p-- | Render the resource using pandoc--pageRenderPandoc::Compiler(PageString)(PageString)pageRenderPandoc=pageRenderPandocWithdefaultHakyllParserStatedefaultHakyllWriterOptions-- | Render the resource using pandoc--pageRenderPandocWith::ParserState->WriterOptions->Compiler(PageString)(PageString)pageRenderPandocWithstateoptions=pageReadPandocWithstate>>^fmap(writePandocWithoptions)-- | The default reader options for pandoc parsing in hakyll--defaultHakyllParserState::ParserStatedefaultHakyllParserState=defaultParserState{-- The following option causes pandoc to read smart typography, a nice-- and free bonus.stateSmart=True}-- | The default writer options for pandoc rendering in hakyll--defaultHakyllWriterOptions::WriterOptionsdefaultHakyllWriterOptions=defaultWriterOptions{-- This option causes literate haskell to be written using '>' marks in-- html, which I think is a good default.writerLiterateHaskell=True}