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

Safe HaskellNone
LanguageHaskell98

Snap.Snaplet.Fay.Internal

Synopsis

Documentation

data Fay Source #

Configuration

Instances

Show Fay Source # 

Methods

showsPrec :: Int -> Fay -> ShowS #

show :: Fay -> String #

showList :: [Fay] -> ShowS #

srcDir :: Fay -> FilePath Source #

Location of .hs files

destDir :: Fay -> FilePath Source #

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 CompileResult Source #

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 -> Bool Source #

Helpers

Checks if a string ends with another string.

filename :: FilePath -> FilePath Source #

Extract the filename from a filepath.

toHsName :: String -> String Source #

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 -> FilePath Source #

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

hsPath :: Fay -> FilePath -> FilePath Source #

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

jsRelativePath :: FilePath -> FilePath Source #

Relative path to a js file.

hsRelativePath :: FilePath -> FilePath Source #

Relative path to a hs file.

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

Print log messages when the verbose flag is set