Safe Haskell | None |
---|---|
Language | Haskell2010 |
Shikensu.
See the README and tests for examples.
Synopsis
- forkDefinition :: FilePath -> Definition -> Definition
- list :: [String] -> FilePath -> IO Dictionary
- listF :: FilePath -> [String] -> IO Dictionary
- listRelative :: [String] -> FilePath -> IO Dictionary
- listRelativeF :: FilePath -> [String] -> IO Dictionary
- makeDefinition :: FilePath -> String -> FilePath -> Definition
- makeDictionary :: FilePath -> (String, [FilePath]) -> Dictionary
- module Shikensu.Internal.Types
Documentation
forkDefinition :: FilePath -> Definition -> Definition Source #
Fork a Definition.
list :: [String] -> FilePath -> IO Dictionary Source #
Make a single dictionary based on a path to a directory and multiple glob patterns.
- Compile patterns so
globDir
can use them. - Run
globDir
function on the given (root) path. - We get a list back for each pattern (ie. a list of lists), here we put each child list in a tuple along with its pattern.
- We make a Dictionary out of each tuple (this also needs the path).
- Merge the dictionaries into one dictionary.
list ["*.md"] "/root/articles"
listRelative :: [String] -> FilePath -> IO Dictionary Source #
Same as list
, but given a relative directory.
listRelative ["*.md"] "./articles"
listRelativeF :: FilePath -> [String] -> IO Dictionary Source #
Flipped version listRelative
.
makeDefinition :: FilePath -> String -> FilePath -> Definition Source #
Make a Definition.
Example definition, given:
- the root path `UsersicidassetProjectsshikensu`
- the pattern `example***.md`
- the absolute path `UsersicidassetProjectsshikensuexampletest/hello.md`
Definition { basename = "hello" , dirname = "test" , extname = ".md" , pattern = "example/**/*.md" , rootDirname = "/Users/icidasset/Projects/shikensu" , workingDirname = "example" , content = Nothing , metadata = KeyMap.empty , parentPath = "../" , pathToRoot = "../../" }
makeDictionary :: FilePath -> (String, [FilePath]) -> Dictionary Source #
Make a Dictionary.
module Shikensu.Internal.Types