From c39ddeb8f86e9dec5bd6096685812452e3f2c65e Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 22 Aug 2021 17:47:18 -0700 Subject: Text.Pandoc.Class: add readStdinStrict method to PandocMonad. [API change] --- src/Text/Pandoc/Class/PandocPure.hs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/Text/Pandoc/Class/PandocPure.hs') 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 -- cgit v1.2.3