summaryrefslogtreecommitdiff
path: root/plugins/WordPressPlugin.hs
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2009-01-24 19:58:06 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2009-01-24 19:58:06 +0000
commit874c3e0deabab154548a3e91e271e86e94ba8502 (patch)
treee976f223d7d1c6435f93ebaf83e8ef0aa7be31a8 /plugins/WordPressPlugin.hs
parent243008242d76017d3828550d2ec23580894d5490 (diff)
Added a plugin system, based on hint.
+ In Text.Pandoc.Definition, added processIn, processInM, and queryIn, and deprecated processPandoc and queryPandoc for these more general functions, which are useful in writing plugins. + Added module Text.Pandoc.Plugins. + Added a --plugins option to Main, and code to run the parsed pandoc document through all the plugins. + Provided five sample plugin files in the plugins/ directory. + Documented --plugin in the pandoc man page and README. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1519 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'plugins/WordPressPlugin.hs')
-rw-r--r--plugins/WordPressPlugin.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/plugins/WordPressPlugin.hs b/plugins/WordPressPlugin.hs
new file mode 100644
index 000000000..85b7ca72b
--- /dev/null
+++ b/plugins/WordPressPlugin.hs
@@ -0,0 +1,10 @@
+module WordPressPlugin (transform) where
+import Text.Pandoc
+
+-- This plugin (when used with -m) prints LaTeX math in the
+-- format required by WordPress blogs. $e=mc^2$ becomes
+-- $LaTeX e=mc^2$.
+
+transform :: Inline -> Inline
+transform (Math x y) = Math x $ "LaTeX " ++ y
+transform x = x