pandoc/plugins/CapitalizeEmphasisPlugin.hs
fiddlosopher 874c3e0dea 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
2009-01-24 19:58:06 +00:00

14 lines
411 B
Haskell

module CapitalizeEmphasisPlugin (transform) where
import Text.Pandoc
import Data.Char (toUpper)
-- This plugin changes emphasized text into CAPITALIZED TEXT.
transform :: [Inline] -> [Inline]
transform (Emph x : ys) = processIn capStr x ++ transform ys
transform (x : ys) = x : transform ys
transform [] = []
capStr :: Inline -> Inline
capStr (Str x) = Str (map toUpper x)
capStr x = x