hsass-0.8.0: Integrating Sass into Haskell applications.

Safe HaskellNone
LanguageHaskell2010

Text.Sass.Compilation

Contents

Description

Compilation of sass source or sass files.

Synopsis

Compilation

compileFile Source #

Arguments

:: SassResult a 
=> FilePath

Path to the file.

-> SassOptions

Compilation options.

-> IO (Either SassError a)

Error or output string.

Compiles a file using specified options.

compileString Source #

Arguments

:: SassResult a 
=> String

String to compile.

-> SassOptions

Compilation options.

-> IO (Either SassError a)

Error or output string.

Compiles raw Sass content using specified options.

compileByteString Source #

Arguments

:: SassResult a 
=> ByteString

String to compile.

-> SassOptions

Compilation options.

-> IO (Either SassError a)

Error or output string.

Compiles raw Sass content using specified options.

Results

data SassExtendedResult a Source #

Represents extended result - compiled string (or other string-like type, eg. ByteString) with a list of includes and a source map.

Subject to name change in future.

type StringResult = IO (Either SassError String) Source #

Result of compilation - Either SassError or a compiled string.

Subject to name change in future.

type ExtendedResult = IO (Either SassError (SassExtendedResult String)) Source #

Result of compilation - Either SassError or extended results - a compiled string with a list of included files and a source map.

Subject to name change in future.

type ExtendedResultBS = IO (Either SassError (SassExtendedResult ByteString)) Source #

Result of compilation - Either SassError or extended results - a compiled ByteString with a list of included files and a source map.

Subject to name change in future.

resultString :: SassExtendedResult a -> a Source #

Compiled string.

resultIncludes :: SassExtendedResult a -> IO [String] Source #

Loads a list of files that have been included during compilation.

resultSourcemap :: SassExtendedResult a -> IO (Maybe String) Source #

Loads a source map if it was generated by libsass.

Error reporting

data SassError Source #

Represents compilation error.

Instances
Eq SassError Source # 
Instance details

Defined in Text.Sass.Compilation

Show SassError Source # 
Instance details

Defined in Text.Sass.Compilation

errorStatus :: SassError -> Int Source #

Compilation satus code.

errorJson :: SassError -> IO String Source #

Loads information about an error as JSON.

errorText :: SassError -> IO String Source #

Loads an error text.

errorMessage :: SassError -> IO String Source #

Loads a user-friendly error message.

errorFile :: SassError -> IO String Source #

Loads a filename where problem occured.

errorSource :: SassError -> IO String Source #

Loads an error source.

errorLine :: SassError -> IO Int Source #

Loads a line in the file where problem occured.

errorColumn :: SassError -> IO Int Source #

Loads a line in the file where problem occured.