diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-09-30 16:07:47 -0500 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-09-30 16:11:20 -0500 |
commit | f3a80034fff41a8b0c13519fa13bed794db1b8d2 (patch) | |
tree | 8355bd3c88b87b960171a65aad05b36e6822e8a4 /src/Text/Pandoc/Readers | |
parent | 9b7d652ab7a0f4cdd86efd92f43f1b20724e8982 (diff) | |
download | pandoc-f3a80034fff41a8b0c13519fa13bed794db1b8d2.tar.gz |
Removed writerSourceURL, add source URL to common state.
Removed `writerSourceURL` from `WriterOptions` (API change).
Added `stSourceURL` to `CommonState`.
It is set automatically by `setInputFiles`.
Text.Pandoc.Class now exports `setInputFiles`, `setOutputFile`.
The type of `getInputFiles` has changed; it now returns `[FilePath]`
instead of `Maybe [FilePath]`.
Functions in Class that formerly took the source URL as a parameter
now have one fewer parameter (`fetchItem`, `downloadOrRead`,
`setMediaResource`, `fillMediaBag`).
Removed `WriterOptions` parameter from `makeSelfContained` in
`SelfContained`.
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r-- | src/Text/Pandoc/Readers/RST.hs | 2 | ||||
-rw-r--r-- | src/Text/Pandoc/Readers/Txt2Tags.hs | 10 |
2 files changed, 3 insertions, 9 deletions
diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs index daaeff2f0..2d6bb979f 100644 --- a/src/Text/Pandoc/Readers/RST.hs +++ b/src/Text/Pandoc/Readers/RST.hs @@ -850,7 +850,7 @@ csvTableDirective top fields rawcsv = do rawcsv' <- case trim <$> lookup "file" fields `mplus` lookup "url" fields of Just u -> do - (bs, _) <- fetchItem Nothing u + (bs, _) <- fetchItem u return $ UTF8.toString bs Nothing -> return rawcsv let res = parseCSV opts (T.pack $ case explicitHeader of diff --git a/src/Text/Pandoc/Readers/Txt2Tags.hs b/src/Text/Pandoc/Readers/Txt2Tags.hs index f000646c2..2d3e541cf 100644 --- a/src/Text/Pandoc/Readers/Txt2Tags.hs +++ b/src/Text/Pandoc/Readers/Txt2Tags.hs @@ -70,14 +70,8 @@ instance Default T2TMeta where -- | Get the meta information required by Txt2Tags macros getT2TMeta :: PandocMonad m => m T2TMeta getT2TMeta = do - mbInps <- P.getInputFiles - let inps = case mbInps of - Just x -> x - Nothing -> [] - mbOutp <- P.getOutputFile - let outp = case mbOutp of - Just x -> x - Nothing -> "" + inps <- P.getInputFiles + outp <- fromMaybe "" <$> P.getOutputFile curDate <- formatTime defaultTimeLocale "%F" <$> P.getZonedTime let getModTime = fmap (formatTime defaultTimeLocale "%T") . P.getModificationTime |