diff options
| author | Miguel <m.i@gmx.at> | 2019-02-18 17:35:09 +0100 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2019-02-18 17:35:09 +0100 |
| commit | 3366fb07342249ccd9037ac487205058c88fabc4 (patch) | |
| tree | f5fcd311663e055626f9b2b92b2d43210ce021e4 /src/WWWStaticus.hs | |
| parent | 217208e3f342d31da541b88af8d06aabbf322f86 (diff) | |
something useful
Diffstat (limited to 'src/WWWStaticus.hs')
| -rw-r--r-- | src/WWWStaticus.hs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/WWWStaticus.hs b/src/WWWStaticus.hs index 2144fe0..d5205f5 100644 --- a/src/WWWStaticus.hs +++ b/src/WWWStaticus.hs @@ -21,9 +21,10 @@ import Data.List -- |Runs WWWStaticus given an input and an output directory and a list of -- plugins. This traverses 'inp' recursively and runs all the plugins --- 'one by one' in each subdirectory recursively. -runStaticus :: FilePath->FilePath->[StaticusPlugin]->IO() -runStaticus inp outp plug= trvDirTree inp (runPlugins plug outp) +-- 'one by one' in each subdirectory recursively. 'root' is the html root +-- directory used in links etc. +runStaticus :: FilePath->FilePath->FilePath->[StaticusPlugin]->IO() +runStaticus inp outp root plug= trvDirTree inp (runPlugins plug root outp) -- |The following structure represents a single WWWStaticus plugin. -- A plugin is defined by a Name and two functions one pure and one that @@ -62,10 +63,11 @@ getDirList d = map ((d++"/")++) <$> filter (not.isPrefixOf ".") <$> listDirector -- |run plugins in a single directory 'path'. -- 'dir_in' and 'dir_out' have to be provided as well, since plugins -- might rely on this -runPlugins::[StaticusPlugin]->FilePath->FilePath->FilePath->IO() -runPlugins plug dir_out dir_in path = foldlM f init plug >> return () +runPlugins::[StaticusPlugin]->FilePath->FilePath->FilePath->FilePath->IO() +runPlugins plug root dir_out dir_in path = foldlM f init plug >> return () where f m (StaticusPlugin name run runIO) = runIO m >>= return.run init= M.fromList [("path",path) ,("dir_in",dir_in) ,("dir_out",dir_out) + ,("html_root",root) ,("log","run plugins at: "++path++"\n")] |
