-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Integrating Sass into Haskell applications. -- -- This package provides quite simple (but not too simple) API for -- compilation of Sass code. It uses libsass (hlibsass) -- underneath, so the code it parses/generates should be compatible with -- original Sass implementation (or at least sassc). This package -- tries to minimize C API usage, so the only place where it is used is -- in the compileFile / compileString methods. This allows -- us to stay pure as long as we can and not waste performance for going -- back and forth. If you feel that compilation options constrain you too -- much, you may use rest of modules without it. With them, you can use -- Haskell types and mechanisms to manage libsass's data(eg. importers, -- options, values) and modify compilation process as you like. @package hsass @version 0.7.0 -- | Helper functions used by Compilation module. module Text.Sass.Marshal.Internal -- | Marshal a NUL terminated C string (UTF-8 encoded) into Haskell string. -- | It is equivalent to peekCString but with different encoding. peekUTF8CString :: CString -> IO String -- | Marshal a Haskell string into a NUL terminated C string (UTF-8 -- encoded). | It is equivalent to newCString but with different -- encoding. newUTF8CString :: String -> IO CString -- | Marshal a Haskell string into a C string (ie, character array) in -- temporary storage, with explicit length information. | It is -- equivalent to withCString but with different encoding. withUTF8CString :: String -> (CString -> IO a) -> IO a -- | Copies ByteString to newly allocated CString. The result -- must be | explicitly freed using free or finalizerFree. newCStringFromBS :: ByteString -> IO CString -- | Helper functions. This module is internal and should not be used in -- production code. module Text.Sass.Utils -- | withOptionalCString str action, if str is -- Nothing, action is not invoked, otherwise behaves like -- withCString. withOptionalUTF8CString :: Maybe String -> (CString -> IO ()) -> IO () -- | Checks if the pointer in state points to non-null location. listEntryNotNull :: (Monad m, MonadIO m) => StateT (Ptr (Ptr a)) m Bool -- | loopCArray action list calls action over -- each element of list that is C array with NULL signifying end -- of array. loopCList :: (Monad m, MonadIO m) => (Ptr a -> m ()) -> Ptr (Ptr a) -> m () -- | Copies converted list of elements to new C array. copyToCList :: (Num size, Enum size) => (CSize -> IO list) -> (a -> IO element) -> (list -> size -> element -> IO ()) -> [a] -> IO list -- | Concatenates list of paths, separating entries with appropriate -- character. concatPaths :: [FilePath] -> FilePath -- | Generates array indices for array of specified length. arrayRange :: (Num a, Integral a, Enum a) => a -> [a] -- | Provides API for managing values that may be extracter from or -- injected to sass source file. module Text.Sass.Values -- | Entry of SassMap. type SassMapEntry = (SassValue, SassValue) -- | Represents value used by libsass. data SassValue -- | Boolean value. SassBool :: Bool -> SassValue -- | Number (value and unit). SassNumber :: Double -> String -> SassValue -- | RGBA color. SassColor :: Double -> Double -> Double -> Double -> SassValue [sassColorR] :: SassValue -> Double [sassColorG] :: SassValue -> Double [sassColorB] :: SassValue -> Double [sassColorA] :: SassValue -> Double -- | String SassString :: String -> SassValue -- | List of SassValues. SassList :: [SassValue] -> SassSeparator -> SassValue -- | Map. SassMap :: [SassMapEntry] -> SassValue -- | Null value. SassNull :: SassValue -- | Warning with message. SassWarning :: String -> SassValue -- | Error with message. SassError :: String -> SassValue -- | Separator used in Sass lists. data SassSeparator :: * SassSeparatorComma :: SassSeparator SassSeparatorSpace :: SassSeparator -- | Marked as internal SassSeparatorHash :: SassSeparator instance GHC.Show.Show Text.Sass.Values.SassValue instance GHC.Classes.Eq Text.Sass.Values.SassValue -- | Provides support for user-defined functions, importers and headers. module Text.Sass.Functions -- | Type of the function that may be used in sass source. type SassFunctionType = SassValue Arguments of the function ('SassList'). -> IO SassValue Result of the computation. -- | Description of the function that may be used in sass source. data SassFunction SassFunction :: String -> SassFunctionType -> SassFunction -- | Signature of the function, parsable by libsass. [funcSignature] :: SassFunction -> String -- | Main function. [funcComputation] :: SassFunction -> SassFunctionType -- | Represents a sass import - a sass content with additional metadata. -- -- Even though this ADT has four fields, you may just provide either -- importPath and importBase and leave loading to the -- library, or provide importSource and do not provide -- importPath nor importBase. Nevertheless, you are free to -- provide all of the fields. data SassImport SassImport :: Maybe FilePath -> Maybe FilePath -> Maybe String -> Maybe String -> SassImport -- | Path to the import, relative to base. [importPath] :: SassImport -> Maybe FilePath -- | Base path. [importBase] :: SassImport -> Maybe FilePath -- | Import's source. [importSource] :: SassImport -> Maybe String -- | Source map of the import. [importSourceMap] :: SassImport -> Maybe String -- | Type of the function that acts like an importer. -- -- You may return the empty list in order to tell libsass to handle the -- import by itself. type SassImporterType = String Path to the import that needs to be loaded. -> String Absolute path to the importing file. -> IO [SassImport] Imports. -- | Description of the importer. data SassImporter SassImporter :: Double -> SassImporterType -> SassImporter -- | Priority of the importer. [importerPriority] :: SassImporter -> Double -- | Main function. [importerFunction] :: SassImporter -> SassImporterType -- | Type of the function that acts like a header. type SassHeaderType = String Absolute path to the file being processed. -> IO [SassImport] Imports. -- | Description of the header. data SassHeader SassHeader :: Double -> SassHeaderType -> SassHeader -- | Priority of the header. [headerPriority] :: SassHeader -> Double -- | Main function. [headerFunction] :: SassHeader -> SassHeaderType -- | makeSourceImport s is equivalent to SassImport -- Nothing Nothing (Just s) Nothing. makeSourceImport :: String -> SassImport -- | makePathImport p b is equivalent to SassImport -- (Just p) (Just b) Nothing Nothing. makePathImport :: String -> String -> SassImport -- | Compilation options. module Text.Sass.Options -- | Describes compilation options. With the exception of -- sassStripEncodingInfo, these correspond to the compilation -- options of libsass. data SassOptions SassOptions :: Int -> SassOutputStyle -> Bool -> Bool -> Bool -> Bool -> Bool -> String -> String -> Maybe FilePath -> Maybe FilePath -> Maybe [FilePath] -> Maybe [FilePath] -> Maybe FilePath -> Maybe String -> Maybe [SassFunction] -> Maybe [SassHeader] -> Maybe [SassImporter] -> Bool -> SassOptions -- | Precision of fractional numbers. [sassPrecision] :: SassOptions -> Int -- | Output style for the generated css code. [sassOutputStyle] :: SassOptions -> SassOutputStyle -- | Emit comments in the generated CSS indicating the corresponding source -- line. [sassSourceComments] :: SassOptions -> Bool -- | Embed sourceMappingUrl as data uri. [sassSourceMapEmbed] :: SassOptions -> Bool -- | Embed include contents in maps. [sassSourceMapContents] :: SassOptions -> Bool -- | Disable sourceMappingUrl in css output. [sassOmitSourceMapUrl] :: SassOptions -> Bool -- | Treat source_string as sass (as opposed to scss). [sassIsIndentedSyntax] :: SassOptions -> Bool -- | String to be used for indentation. [sassIndent] :: SassOptions -> String -- | String to be used to for line feeds. [sassLinefeed] :: SassOptions -> String -- | The input path used for source map generation. It can be used to -- define something with string compilation or to overload the input file -- path. [sassInputPath] :: SassOptions -> Maybe FilePath -- | The output path used for source map generation. [sassOutputPath] :: SassOptions -> Maybe FilePath -- | Paths used to load plugins by libsass. [sassPluginPaths] :: SassOptions -> Maybe [FilePath] -- | Paths used to resolve @include. [sassIncludePaths] :: SassOptions -> Maybe [FilePath] -- | Path to source map file. Enables source map generation and is used to -- create sourceMappingUrl [sassSourceMapFile] :: SassOptions -> Maybe FilePath -- | Directly inserted in source maps. [sassSourceMapRoot] :: SassOptions -> Maybe String -- | List of user-supplied functions that may be used in sass files. [sassFunctions] :: SassOptions -> Maybe [SassFunction] -- | List of user-supplied functions that provide "headers" for sass files. -- Header is injected at the beginning of a file which name is passed as -- the first argument of importer. [sassHeaders] :: SassOptions -> Maybe [SassHeader] -- | List of user-supplied functions that resolve @import directives. [sassImporters] :: SassOptions -> Maybe [SassImporter] -- | Remove @charset "UTF-8";\n or byte-order mark from CSS -- output, if present. [sassStripEncodingInfo] :: SassOptions -> Bool -- | The default SassOptions: -- --