Start worknig on templates
This commit is contained in:
@@ -4,8 +4,8 @@ import Types
|
||||
import ComputationM
|
||||
import Functions
|
||||
|
||||
handleRecipeDir :: Token FilePath -> ComputationM ()
|
||||
handleRecipeDir dir = do
|
||||
handleRecipeDir :: Token Template -> Token FilePath -> ComputationM ()
|
||||
handleRecipeDir template dir = do
|
||||
dirContents <- listDirectory dir
|
||||
imageFilenames <- filterComputationM isImageFilename dirContents
|
||||
convertedImageFilenames <- mapComputationM convertedImageFilename imageFilenames
|
||||
@@ -15,9 +15,11 @@ handleRecipeDir dir = do
|
||||
|
||||
test :: ComputationM ()
|
||||
test = do
|
||||
templateFilename <- inject "template.html"
|
||||
template <- readTemplate templateFilename
|
||||
dir <- inject "retter"
|
||||
dirContents <- listDirectory dir
|
||||
mapComputationM_ handleRecipeDir dirContents
|
||||
mapComputationM_ (handleRecipeDir template) dirContents
|
||||
|
||||
main :: IO ()
|
||||
main = mapM_ print $ evalComputationM test
|
||||
|
||||
Reference in New Issue
Block a user