diff options
author | John MacFarlane <jgm@berkeley.edu> | 2021-08-22 17:47:18 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2021-08-24 22:19:15 -0700 |
commit | c39ddeb8f86e9dec5bd6096685812452e3f2c65e (patch) | |
tree | 7c9425531bcf7b60a9f1c8b9ef789ca3261ba91f /src/Text/Pandoc/Class/PandocPure.hs | |
parent | 8ad22002cb5ac4c79acda84c7256c6a122e2dd93 (diff) | |
download | pandoc-c39ddeb8f86e9dec5bd6096685812452e3f2c65e.tar.gz |
Text.Pandoc.Class: add readStdinStrict method to PandocMonad.
[API change]
Diffstat (limited to 'src/Text/Pandoc/Class/PandocPure.hs')
-rw-r--r-- | src/Text/Pandoc/Class/PandocPure.hs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Class/PandocPure.hs b/src/Text/Pandoc/Class/PandocPure.hs index 23c941839..290a6d97c 100644 --- a/src/Text/Pandoc/Class/PandocPure.hs +++ b/src/Text/Pandoc/Class/PandocPure.hs @@ -64,6 +64,7 @@ data PureState = PureState , stReferencePptx :: Archive , stReferenceODT :: Archive , stFiles :: FileTree + , stStdin :: B.ByteString , stUserDataFiles :: FileTree , stCabalDataFiles :: FileTree } @@ -80,6 +81,7 @@ instance Default PureState where , stReferencePptx = emptyArchive , stReferenceODT = emptyArchive , stFiles = mempty + , stStdin = mempty , stUserDataFiles = mempty , stCabalDataFiles = mempty } @@ -193,6 +195,8 @@ instance PandocMonad PandocPure where Just bs -> return bs Nothing -> throwError $ PandocResourceNotFound $ T.pack fp + readStdinStrict = getsPureState stStdin + glob s = do FileTree ftmap <- getsPureState stFiles return $ filter (match (compile s)) $ M.keys ftmap |