hsass-0.4.1: Integrating Sass into Haskell applications.

Safe HaskellNone
LanguageHaskell2010

Text.Sass.Compilation

Contents

Description

Compilation of sass source or sass files.

Synopsis

Compilation

compileFile #

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 #

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.

Results

data SassExtendedResult a #

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) #

Result of compilation - Either SassError or a compiled string.

Subject to name change in future.

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

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)) #

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 #

Compiled string.

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

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

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

Loads a source map if it was generated by libsass.

Error reporting

data SassError #

Represents compilation error.

errorStatus :: SassError -> Int #

Compilation satus code.

errorJson :: SassError -> IO String #

Loads information about an error as JSON.

errorText :: SassError -> IO String #

Loads an error text.

errorMessage :: SassError -> IO String #

Loads a user-friendly error message.

errorFile :: SassError -> IO String #

Loads a filename where problem occured.

errorSource :: SassError -> IO String #

Loads an error source.

errorLine :: SassError -> IO Int #

Loads a line in the file where problem occured.

errorColumn :: SassError -> IO Int #

Loads a line in the file where problem occured.