Safe Haskell | None |
---|---|
Language | Haskell2010 |
Compilation of sass source or sass files.
- compileFile :: SassResult a => FilePath -> SassOptions -> IO (Either SassError a)
- compileString :: SassResult a => String -> SassOptions -> IO (Either SassError a)
- data SassExtendedResult a
- type StringResult = IO (Either SassError String)
- type ExtendedResult = IO (Either SassError (SassExtendedResult String))
- type ExtendedResultBS = IO (Either SassError (SassExtendedResult ByteString))
- resultString :: SassExtendedResult a -> a
- resultIncludes :: SassExtendedResult a -> IO [String]
- resultSourcemap :: SassExtendedResult a -> IO (Maybe String)
- data SassError
- errorStatus :: SassError -> Int
- errorJson :: SassError -> IO String
- errorText :: SassError -> IO String
- errorMessage :: SassError -> IO String
- errorFile :: SassError -> IO String
- errorSource :: SassError -> IO String
- errorLine :: SassError -> IO Int
- errorColumn :: SassError -> IO Int
Compilation
:: SassResult a | |
=> FilePath | Path to the file. |
-> SassOptions | Compilation options. |
-> IO (Either SassError a) | Error or output string. |
Compiles a file using specified options.
:: 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 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 ExtendedResult = IO (Either SassError (SassExtendedResult String)) Source
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
errorStatus :: SassError -> Int Source
Compilation satus code.
errorMessage :: SassError -> IO String Source
Loads a user-friendly error message.
errorSource :: SassError -> IO String Source
Loads an error source.
errorColumn :: SassError -> IO Int Source
Loads a line in the file where problem occured.