From bd5a5d48e7cdf6fb36db05a71d69a0aa5f09e116 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Thu, 12 Jul 2007 08:32:57 +0000 Subject: Cleaned up Text.Pandoc. Added lots of documentation, including an example program. git-svn-id: https://pandoc.googlecode.com/svn/trunk@691 788f1e2b-df1e-0410-8736-df70ead52e1b --- src/Text/Pandoc.hs | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) (limited to 'src/Text') diff --git a/src/Text/Pandoc.hs b/src/Text/Pandoc.hs index a4738686b..2be7d9642 100644 --- a/src/Text/Pandoc.hs +++ b/src/Text/Pandoc.hs @@ -25,8 +25,25 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Stability : alpha Portability : portable -This helper module exports the basic writers, readers, and definitions -from the Pandoc libraries. +This helper module exports the main writers, readers, and data +structure definitions from the Pandoc libraries. + +A typical application will chain together a reader and a writer +to convert strings from one format to another. For example, the +following simple program will act as a filter converting markdown +fragments to reStructuredText, using reference-style links instead of +inline links: + +> module Main where +> import Text.Pandoc +> +> markdownToRST :: String -> String +> markdownToRST = encodeUTF8 . +> (writeRST defaultWriterOptions {writerReferenceLinks = True}) . +> (readMarkdown defaultParserState) . decodeUTF8 +> +> main = interact markdownToRST + -} module Text.Pandoc @@ -41,6 +58,11 @@ module Text.Pandoc -- * Parser state used in readers , ParserState (..) , defaultParserState + , ParserContext (..) + , QuoteContext (..) + , KeyTable + , NoteTable + , HeaderType (..) -- * Writers: converting /from/ Pandoc format , writeMarkdown , writeRST @@ -48,6 +70,7 @@ module Text.Pandoc , writeHtml , writeHtmlString , writeS5 + , writeS5String , writeDocbook , writeMan , writeRTF @@ -55,9 +78,10 @@ module Text.Pandoc -- * Writer options used in writers , WriterOptions (..) , defaultWriterOptions - -- * UTF-8 encoding and decoding - , encodeUTF8 - , decodeUTF8 + -- * Default headers for various output formats + , module Text.Pandoc.Writers.DefaultHeaders + -- * Functions for converting to and from UTF-8 + , module Text.Pandoc.UTF8 ) where import Text.Pandoc.Definition @@ -73,6 +97,7 @@ import Text.Pandoc.Writers.S5 import Text.Pandoc.Writers.Docbook import Text.Pandoc.Writers.Man import Text.Pandoc.Writers.RTF +import Text.Pandoc.Writers.DefaultHeaders import Text.Pandoc.UTF8 import Text.Pandoc.Shared -- cgit v1.2.3