git.iko.soy/typeable/pandoc
on ca2bbaf help sign in
typeable/pandoc/plugins/ListLinksPlugin.hs
15 lines 432 B history raw
1module ListLinksPlugin (transform) where
2import Text.Pandoc
4-- This plugin returns an empty document and prints a list
5-- of the URLs linked to in the source document.
7transform :: Pandoc -> IO Pandoc
8transform p = do
9 let urls = queryWith findURLs p
10 putStrLn $ unlines urls
11 return $ Pandoc (Meta [] [] []) []
13findURLs :: Inline -> [String]
14findURLs (Link label (url, title)) = [url]
15findURLs x = []