Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module deals with locating assets on the disk, and determining which assets needs preprocessing.
In development mode: * At startup, build a mapping of source files to destination files together with any preprocessors that should be run on them (based on extension) * watch for filesystem changes, and rebuild relevant parts of this mapping when necessary * listen for HTTP requests and serve relevant files, performing preprocessing where necessary. (well, eventually do all that. For now just rebuild the BuildMapping for each request).
In production mode: * build the mapping * preprocess all the files and output them to a particular directory.
This architecture should ensure that the file mapping is identical in each mode.
- getBuildMapping :: Herringbone -> IO BuildMapping
- getBuildSpec :: Herringbone -> FilePath -> BuildSpec
- makeDestAbsolute :: Herringbone -> BuildSpec -> IO BuildSpec
- swapExtension :: PP -> FilePath -> Maybe FilePath
- swapExtension' :: Text -> Text -> FilePath -> Maybe FilePath
- searchForFile :: [FilePath] -> FilePath -> IO (Maybe FilePath)
Documentation
getBuildSpec :: Herringbone -> FilePath -> BuildSpec Source
Given a FilePath of a source file, construct a BuildSpec for the file.
makeDestAbsolute :: Herringbone -> BuildSpec -> IO BuildSpec Source
Make the destination path of a BuildSpec absolute, using the destination directory of the given Herringbone.