-- 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.4.2 -- | 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 -- | 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. withOptionalCString :: 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] -- | Conversion of SassValue or list of SassValues into -- native representation. This module is internal and should not be -- considered stable. module Text.Sass.Values.Internal -- | Converts a SassValue to native type. toNativeValue :: SassValue -> IO (Ptr SassValue) -- | Converts native value to SassValue. fromNativeValue :: Ptr SassValue -> IO SassValue -- | Frees native representation of SassValue. deleteNativeValue :: Ptr SassValue -> IO () -- | Makes ForeignPtr from Ptr to native representation of -- SassValue. makeValueForeignPtr :: Ptr SassValue -> IO (ForeignPtr SassValue) -- | Provides utility functions for working with SassValues module Text.Sass.Values.Utils -- | Combines two SassValues using specified operator. | | Uses -- sass_value_op. combineSassValues :: SassOp -> SassValue -> SassValue -> SassValue -- | Operator used to combine two SassValues. data SassOp :: * SassAnd :: SassOp SassOr :: SassOp SassEq :: SassOp SassNeq :: SassOp SassGt :: SassOp SassGte :: SassOp SassLt :: SassOp SassLte :: SassOp SassAdd :: SassOp SassSub :: SassOp SassMul :: SassOp SassDiv :: SassOp SassMod :: SassOp SassNumOps :: SassOp -- | 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 importer/header. -- -- You may return empty list in order to tell libsass to handle the -- import by itself or not insert any header. type SassImporterType = String Path to the import that needs to be loaded or file that is being processed when used as a header. -> 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 -- | 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 module Text.Sass.Functions.Internal -- | Wraps function of type SassFunctionType into function that may -- be passed to native library. wrapFunction :: SassFunctionType -> SassFunctionFnType -- | Converts SassFunction into native representation. -- -- Freeing native representation is not a pleasant process - libsass -- frees the SassFunctionEntry, but does not free signature. -- Because of that, special care must be taken in order to properly -- deallocate the object. If you don't want to pass the resulting object -- to Sass_Options, call both clearNativeFunction and then -- freeNativeFunction. Otherwise, you should call -- clearNativeFunction BEFORE you deallocate context. makeNativeFunction :: SassFunction -> IO SassFunctionEntry -- | Releases the signature of a function entry. clearNativeFunction :: SassFunctionEntry -> IO () -- | Deallocates the object, but does not deallocate signature. freeNativeFunction :: SassFunctionEntry -> IO () -- | Converts list of SassFunctions into native representation. -- -- There is analogous problem in relation to deallocation of the result -- as with makeNativeFunction. See documentation above for -- explanation. makeNativeFunctionList :: [SassFunction] -> IO SassFunctionList -- | Releases signatures of entries in the list. clearNativeFunctionList :: SassFunctionList -> IO () -- | Frees the list and entries, without releasing signatures. freeNativeFunctionList :: SassFunctionList -> IO () -- | Wraps function of type SassImporterType. wrapImporter :: SassImporterType -> SassImporterFnType -- | Converts SassImport into native representation. makeNativeImport :: SassImport -> IO SassImportEntry -- | Frees native representation of SassImport. freeNativeImport :: SassImportEntry -> IO () -- | Converts list of SassImports into native representation. makeNativeImportList :: [SassImport] -> IO SassImportList -- | Frees native representation of list of SassEntry, including -- entries. freeNativeImportList :: SassImportList -> IO () -- | Converts SassImporter into native representation. makeNativeImporter :: SassImporter -> IO SassImporterEntry -- | Frees native representation of SassImporter. freeNativeImporter :: SassImporterEntry -> IO () -- | Makes native representation of list of SassImporters. makeNativeImporterList :: [SassImporter] -> IO SassImporterList -- | Frees list of native representations of SassImporters. -- -- Libsass does not provide function to free this kind of objects, but we -- provide it just in case. freeNativeImporterList :: SassImporterList -> IO () -- | Compilation options. module Text.Sass.Options -- | Describes options used by libsass during compilation. 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 [SassImporter] -> Maybe [SassImporter] -> 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 [SassImporter] -- | List of user-supplied functions that resolve @import directives. [sassImporters] :: SassOptions -> Maybe [SassImporter] -- | The default SassOptions: -- --