hakyll-process-0.0.2.0: Hakyll compiler for arbitrary external processes.

Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Hakyll.Process

Description

 
Synopsis

Documentation

newExtension Source #

Arguments

:: String

New file extension, excluding the leading "."

-> FilePath

Original FilePath

-> FilePath 

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

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.

unsafeExecCompiler Source #

Arguments

:: 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.

Constructors

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

Constructors

HakFilePath

Abstract representation of the path to the Hakyll item.

ProcArg String

Literal argument to provide to the other process.

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

data OutFilePath Source #

Specifies the output file path of a process.

Constructors

SpecificPath FilePath

A specific, known filepath.

RelativePath (FilePath -> FilePath)

Indicates that the output path is related to the input path.