9da6912f7a
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1526 788f1e2b-df1e-0410-8736-df70ead52e1b
15 lines
432 B
Haskell
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 = []
|