@@ -70,7 +70,7 @@ import System.IO.Error (isDoesNotExistError)
7070import Text.Pandoc
7171import Text.Pandoc.Builder (setMeta)
7272import Text.Pandoc.Class (PandocIO, getLog, withMediaBag,
73− extractMedia, fillMediaBag)
73+ extractMedia, fillMediaBag, setResourcePath)
7474import Text.Pandoc.Highlighting (highlightingStyles)
7575import Text.Pandoc.Lua ( runLuaFilter )
7676import Text.Pandoc.PDF (makePDF)
@@ -414,6 +414,7 @@ convertWithOpts opts = do
414414 let eol = fromMaybe nativeNewline $ optEol opts
415415
416416 runIO' $ do
417+ setResourcePath $ "." : (optResourcePath opts)
417418 (doc, media) <- withMediaBag $ sourceToDoc sources >>=
418419 ( (if isJust (optExtractMedia opts)
419420 then fillMediaBag (writerSourceURL writerOptions)
@@ -569,6 +570,7 @@ data Opt = Opt
569570 , optIncludeBeforeBody :: [FilePath] -- ^ Files to include before
570571 , optIncludeAfterBody :: [FilePath] -- ^ Files to include after body
571572 , optIncludeInHeader :: [FilePath] -- ^ Files to include in header
573+ , optResourcePath :: [FilePath] -- ^ Path to search for images etc
572574 , optEol :: Maybe Newline -- ^ Enforce line-endings
573575 }
574576
@@ -638,6 +640,7 @@ defaultOpts = Opt
638640 , optIncludeBeforeBody = []
639641 , optIncludeAfterBody = []
640642 , optIncludeInHeader = []
643+ , optResourcePath = []
641644 , optEol = Nothing
642645 }
643646
@@ -1052,6 +1055,14 @@ options =
10521055 "FILE")
10531056 "" -- "File to include after document body"
10541057
1058+ , Option "" ["resource-path"]
1059+ (ReqArg
1060+ (\arg opt -> return opt { optResourcePath =
1061+ splitSearchPath arg })
1062+ "SEARCHPATH")
1063+ "" -- "Paths to search for images and other resources"
1064+
1065+
10551066 , Option "" ["self-contained"]
10561067 (NoArg
10571068 (\opt -> return opt { optSelfContained = True,