pandoc/plugins/ListLinksPlugin.hs
2009-01-24 19:59:15 +00:00

15 lines
432 B
Haskell

module ListLinksPlugin (transform) where
import Text.Pandoc
-- This plugin returns an empty document and prints a list
-- of the URLs linked to in the source document.
transform :: Pandoc -> IO Pandoc
transform p = do
let urls = queryWith findURLs p
putStrLn $ unlines urls
return $ Pandoc (Meta [] [] []) []
findURLs :: Inline -> [String]
findURLs (Link label (url, title)) = [url]
findURLs x = []