Stability | experimental |
---|---|
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- newExtension :: String -> FilePath -> FilePath
- newExtOutFilePath :: String -> CompilerOut
- execName :: String -> ExecutableName
- execCompiler :: ExecutableName -> CompilerOut -> Compiler (Item ByteString)
- execCompilerWith :: ExecutableName -> ExecutableArgs -> CompilerOut -> Compiler (Item ByteString)
- unsafeExecCompiler :: ExecutableName -> [String] -> (ByteString -> IO ByteString) -> Compiler (Item ByteString)
- data CompilerOut
- data ExecutableArg
- type ExecutableArgs = [ExecutableArg]
- data ExecutableName
- data OutFilePath
- = SpecificPath FilePath
- | RelativePath (FilePath -> FilePath)
Documentation
Helper function to indicate that the output file name is the same as the input file name with a new extension Note: like hakyll, assumes that no "." is present in the extension
newExtOutFilePath :: String -> CompilerOut Source #
Helper function to indicate that the output file name is the same as the input file name with a new extension Note: like hakyll, assumes that no "." is present in the extension
execName :: String -> ExecutableName Source #
execCompiler :: ExecutableName -> CompilerOut -> Compiler (Item ByteString) Source #
Calls the external compiler with no arguments. Returns the output contents as a ByteString
.
If an error occurs this raises an exception.
May be useful if you already have build scripts for artifacts in your repository.
execCompilerWith :: ExecutableName -> ExecutableArgs -> CompilerOut -> Compiler (Item ByteString) Source #
Calls the external compiler with the provided arguments. Returns the output contents as a ByteString
.
If an error occurs this raises an exception.
:: ExecutableName | Name or filepath of the executable |
-> [String] | Arguments to pass to the executable |
-> (ByteString -> IO ByteString) | Action to read the output of the compiler. Input is the stdout of the process. |
-> Compiler (Item ByteString) |
Primarily for internal use, occasionally useful when already building a compiler imperatively.
Allows the caller to opt out of the declarative components of execCompiler
and execCompilerWith
.
data CompilerOut Source #
Expected output from the external compiler.
CStdOut | Compiler uses stdout as the output type. |
COutFile OutFilePath | Compiler outputs to a specific target file on the filesystem. |
data ExecutableArg Source #
Arguments to provide to the process
HakFilePath | Abstract representation of the path to the Hakyll item. |
ProcArg String | Literal argument to provide to the other process. |
Instances
Read ExecutableArg Source # | |
Defined in Hakyll.Process readsPrec :: Int -> ReadS ExecutableArg # readList :: ReadS [ExecutableArg] # | |
Show ExecutableArg Source # | |
Defined in Hakyll.Process showsPrec :: Int -> ExecutableArg -> ShowS # show :: ExecutableArg -> String # showList :: [ExecutableArg] -> ShowS # |
type ExecutableArgs = [ExecutableArg] Source #
Arguments to pass to the executable. Empty if none.
data ExecutableName Source #
Name of the executable if in the PATH or path to it if not
Instances
Read ExecutableName Source # | |
Defined in Hakyll.Process readsPrec :: Int -> ReadS ExecutableName # readList :: ReadS [ExecutableName] # | |
Show ExecutableName Source # | |
Defined in Hakyll.Process showsPrec :: Int -> ExecutableName -> ShowS # show :: ExecutableName -> String # showList :: [ExecutableName] -> ShowS # |
data OutFilePath Source #
Specifies the output file path of a process.
SpecificPath FilePath | A specific, known filepath. |
RelativePath (FilePath -> FilePath) | Indicates that the output path is related to the input path. |