@@ -106,6 +106,7 @@ module Text.Pandoc
106 , module Text.Pandoc.Templates
106 , module Text.Pandoc.Templates
107 -- * Version
107 -- * Version
108 , pandocVersion
108 , pandocVersion
111import Text.Pandoc.Definition
112import Text.Pandoc.Definition
@@ -190,3 +191,9 @@ writers = [("native" , writeNative)
190 ,("rtf" , writeRTF)
191 ,("rtf" , writeRTF)
191 ,("org" , writeOrg)
192 ,("org" , writeOrg)
195+-- | Converts a transformation on the Pandoc AST into a function
196+-- that reads and writes a JSON-encoded string. This is useful
197+-- for writing small scripts.
198+jsonFilter :: (Pandoc -> Pandoc) -> String -> String
199+jsonFilter f = encodeJSON . f . decodeJSON