shikensu-0.1.1: A small toolset for building static websites

Safe HaskellNone
LanguageHaskell2010

Shikensu.Utilities

Description

Utilities, mainly for internal use.

Synopsis

Documentation

cleanPath :: FilePath -> FilePath Source #

"Clean up" a path.

`/directory/./nested/` -> `directory/nested`
`./` -> ``
`.` -> ``

commonDirectory :: Pattern -> FilePath Source #

Get the common directory from a Pattern.

compilePatterns :: [Pattern] -> [Pattern] Source #

Compile a list of Patterns to Patterns.

compileParentPath :: FilePath -> Maybe FilePath Source #

Path to parent, when there is one.

Just "../" or Nothing

compilePathToRoot :: FilePath -> FilePath Source #

Path to root.

Example, if dirname is 'example/subdir', then this will be ../../.

If the dirname is empty, then this will be empty as well.

globDir :: FilePath -> [Pattern] -> IO [[FilePath]] Source #

List contents of a directory using a glob pattern. Returns a relative path, based on the given rootDirname.

io :: ([Definition] -> [IO Definition]) -> Dictionary -> IO Dictionary Source #

IO Sequence helpers

replaceSingleDot :: String -> String Source #

If the path is a single dot, return an empty string. Otherwise return the path.

stripPrefix :: String -> String -> String Source #

Strip prefix.

takeDirName :: FilePath -> FilePath Source #

Take dirname.