summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-07-12 08:32:57 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-07-12 08:32:57 +0000
commitbd5a5d48e7cdf6fb36db05a71d69a0aa5f09e116 (patch)
tree557175f93a5f706ac7a7d6d3620128a6660f7f89 /src
parente962c76f0546671011c319612d6cd82dca4eef0e (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc.hs35
1 files changed, 30 insertions, 5 deletions
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