2009-01-24 20:58:06 +01:00
|
|
|
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
|
2009-01-24 20:59:15 +01:00
|
|
|
let urls = queryWith findURLs p
|
2009-01-24 20:58:06 +01:00
|
|
|
putStrLn $ unlines urls
|
|
|
|
return $ Pandoc (Meta [] [] []) []
|
|
|
|
|
|
|
|
findURLs :: Inline -> [String]
|
|
|
|
findURLs (Link label (url, title)) = [url]
|
|
|
|
findURLs x = []
|