snaplet-fay-0.3.3.1: Fay integration for Snap with request- and pre-compilation.

Safe HaskellNone

Snap.Snaplet.Fay.Internal

Synopsis

Documentation

data Fay Source

Configuration

Instances

srcDir :: Fay -> FilePathSource

Location of .hs files

destDir :: Fay -> FilePathSource

Location of .js files

includeDirs :: Fay -> [FilePath]Source

Where to check for imports

data CompileMode Source

Compile on every request or when Snap starts.

Constructors

Development 
Production 

data CompileResult Source

Used by callers of compileFile to get the status of compilation.

compileFile :: Fay -> FilePath -> IO CompileResultSource

Compile a single file, print errors if they occur and return the | compiled source if successful.

compileAll :: Fay -> IO ()Source

Checks the specified source folder and compiles all new and modified scripts. Also removes any js files whose Fay source has been deleted. All files are checked each request.

hasSuffix :: String -> String -> BoolSource

Helpers

Checks if a string ends with another string.

filename :: FilePath -> FilePathSource

Extract the filename from a filepath.

toHsName :: String -> StringSource

Convert a JS filename to a Haskell filename.

extFiles :: String -> FilePath -> IO [FilePath]Source

Gets the filepath of the files with the given file extension in a folder.

jsPath :: Fay -> FilePath -> FilePathSource

Convert from the location of a js file to the location of its source hs file.

hsPath :: Fay -> FilePath -> FilePathSource

Convert from the location of a hs file to the location of the destination js file.

jsRelativePath :: FilePath -> FilePathSource

Relative path to a js file.

hsRelativePath :: FilePath -> FilePathSource

Relative path to a hs file.

verbosePut :: Fay -> String -> IO ()Source

Print log messages when the verbose flag is set