aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Options.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2013-08-11 15:58:09 -0700
committerJohn MacFarlane <fiddlosopher@gmail.com>2013-08-11 15:58:09 -0700
commite279175ea517e2df65fe5d716bc02e383b04fc36 (patch)
treecafdb6b78c8a399e8fb0ac9c8e1c3ba5a8fef153 /src/Text/Pandoc/Options.hs
parent6f736dfa7578faab7b90546ee5b2c275185968c8 (diff)
downloadpandoc-e279175ea517e2df65fe5d716bc02e383b04fc36.tar.gz
Options: Changed `writerSourceDir` to `writerSourceURL` (now a Maybe).
Previously we used to store the directory of the first input file, even if it was local, and used this as a base directory for finding images in ODT, EPUB, Docx, and PDF. This has been confusing to many users. It seems better to look for images relative to the current working directory, even if the first file argument is in another directory. writerSourceURL is set to 'Just url' when the first command-line argument is an absolute URL. (So, relative links will be resolved in relation to the first page.) Otherwise, 'Nothing'. The ODT, EPUB, Docx, and PDF writers have been modified accordingly. Note that this change may break some existing workflows. If you have been assuming that relative links will be interpreted relative to the directory of the first file argument, you'll need to make that the current directory before running pandoc. Closes #942.
Diffstat (limited to 'src/Text/Pandoc/Options.hs')
-rw-r--r--src/Text/Pandoc/Options.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Options.hs b/src/Text/Pandoc/Options.hs
index 61a85cf6e..c7c37d6b8 100644
--- a/src/Text/Pandoc/Options.hs
+++ b/src/Text/Pandoc/Options.hs
@@ -286,7 +286,7 @@ data WriterOptions = WriterOptions
, writerEmailObfuscation :: ObfuscationMethod -- ^ How to obfuscate emails
, writerIdentifierPrefix :: String -- ^ Prefix for section & note ids in HTML
-- and for footnote marks in markdown
- , writerSourceDirectory :: FilePath -- ^ Directory path of 1st source file
+ , writerSourceURL :: Maybe String -- ^ Absolute URL + directory of 1st source file
, writerUserDataDir :: Maybe FilePath -- ^ Path of user data directory
, writerCiteMethod :: CiteMethod -- ^ How to print cites
, writerBiblioFiles :: [FilePath] -- ^ Biblio files to use for citations
@@ -329,7 +329,7 @@ instance Default WriterOptions where
, writerColumns = 72
, writerEmailObfuscation = JavascriptObfuscation
, writerIdentifierPrefix = ""
- , writerSourceDirectory = "."
+ , writerSourceURL = Nothing
, writerUserDataDir = Nothing
, writerCiteMethod = Citeproc
, writerBiblioFiles = []