-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A simple static site generator library. -- -- A simple static site generator library, mainly aimed at creating blogs -- and brochure sites. @package hakyll @version 1.1 module Text.Hakyll.Util -- | Trim a string (drop spaces and tabs at both sides). trim :: String -> String -- | Strip html tags. stripHTML :: String -> String -- | Make a HTML link. -- --
--   link "foo" "bar.html" == "<a href='bar.html'>foo</a>"
--   
link :: String -> String -> String -- | A module that exports a simple regex interface. This code is mostly -- copied from the regex-compat package at hackage. I decided to write -- this module because I want to abstract the regex package used. module Text.Hakyll.Regex -- | Split a list at a certain element. splitRegex :: String -> String -> [String] -- | Substitute a regex. Simplified interface. This function performs a -- global substitution. substituteRegex :: String -> String -> String -> String -- | Simple regex matching. matchesRegex :: String -> String -> Bool module Text.Hakyll.CompressCSS -- | Compress CSS to speed up your site. compressCSS :: String -> String -- | Module containing various functions to manipulate contexts. module Text.Hakyll.Context -- | Type for a context. type Context = Map String String -- | Type for context manipulating functions. type ContextManipulation = Context -> Context -- | Do something with a value of a context. renderValue :: String -> String -> (String -> String) -> ContextManipulation -- | When the context has a key called path in a -- yyyy-mm-dd-title.extension format (default for pages), this -- function can render the date. renderDate :: String -> String -> String -> ContextManipulation -- | Module describing the Hakyll monad stack. module Text.Hakyll.Hakyll -- | Hakyll global configuration type. data HakyllConfiguration HakyllConfiguration :: Context -> HakyllConfiguration -- | An additional context to use when rendering. This additional context -- is used globally. additionalContext :: HakyllConfiguration -> Context -- | Our custom monad stack. type Hakyll = ReaderT HakyllConfiguration IO -- | Simplified ask function for the Hakyll monad stack. askHakyll :: (HakyllConfiguration -> a) -> Hakyll a module Text.Hakyll.Renderable -- | A class for datatypes that can be rendered to pages. class Renderable a toContext :: (Renderable a) => a -> Hakyll Context getDependencies :: (Renderable a) => a -> [FilePath] getURL :: (Renderable a) => a -> FilePath -- | A module containing various function for manipulating and examinating -- files and directories. module Text.Hakyll.File -- | Convert a relative filepath to a filepath in the destination -- (_site). toDestination :: FilePath -> FilePath -- | Get the url for a given page. toURL :: FilePath -> FilePath -- | Get the relative url to the site root, for a given (absolute) url toRoot :: FilePath -> FilePath -- | Swaps spaces for -. removeSpaces :: FilePath -> FilePath -- | Given a path to a file, try to make the path writable by making all -- directories on the path. makeDirectories :: FilePath -> Hakyll () -- | Get all contents of a directory. Note that files starting with a dot -- (.) will be ignored. getRecursiveContents :: FilePath -> Hakyll [FilePath] -- | A filter that takes all file names with a given extension. Prefix the -- extension with a dot: -- --
--   havingExtension ".markdown" [ "index.markdown"
--                               , "style.css"
--                               ] == ["index.markdown"]
--   
havingExtension :: String -> [FilePath] -> [FilePath] -- | Check if a cache file is still valid. isCacheValid :: FilePath -> [FilePath] -> Hakyll Bool -- | Perform a Hakyll action on every file in a given directory. directory :: (FilePath -> Hakyll ()) -> FilePath -> Hakyll () module Text.Hakyll.Page -- | A Page is basically key-value mapping. Certain keys have special -- meanings, like for example url, body and title. data Page -- | Create a Page from a key-value mapping. fromContext :: Context -> Page -- | Obtain a value from a page. Will resturn an empty string when nothing -- is found. getValue :: String -> Page -> String -- | Get the body for a certain page. When not defined, the body will be -- empty. getBody :: Page -> String -- | Read a page from a file. Metadata is supported, and if the filename -- has a .markdown extension, it will be rendered using pandoc. readPage :: FilePath -> Hakyll Page -- | Split a page into sections. splitAtDelimiters :: [String] -> [[String]] instance Renderable Page module Text.Hakyll.Render -- | Execute an IO action only when the cache is invalid. depends :: FilePath -> [FilePath] -> Hakyll () -> Hakyll () -- | Render to a Page. render :: (Renderable a) => FilePath -> a -> Hakyll Page -- | Render to a Page. This function allows you to manipulate the context -- first. renderWith :: (Renderable a) => ContextManipulation -> FilePath -> a -> Hakyll Page -- | Render each renderable with the given templates, then concatenate the -- result. So, basically this function: -- -- renderAndConcat :: (Renderable a) => [FilePath] -> [a] -> Hakyll String -- | Render each renderable with the given templates, then concatenate the -- result. This function allows you to specify a -- ContextManipulation to apply on every Renderable. renderAndConcatWith :: (Renderable a) => ContextManipulation -> [FilePath] -> [a] -> Hakyll String -- | Chain a render action for a page with a number of templates. This will -- also write the result to the site destination. This is the preferred -- way to do general rendering. -- --
--   renderChain [ "templates/notice.html"
--               , "templates/default.html"
--               ] $ createPagePath "warning.html"
--   
-- -- This code will first render warning.html using -- templates/notice.html, and will then render the result with -- templates/default.html. renderChain :: (Renderable a) => [FilePath] -> a -> Hakyll () -- | A more custom render chain that allows you to specify a -- ContextManipulation which to apply on the context when it is -- read first. renderChainWith :: (Renderable a) => ContextManipulation -> [FilePath] -> a -> Hakyll () -- | Mark a certain file as static, so it will just be copied when the site -- is generated. static :: FilePath -> Hakyll () -- | Render a css file, compressing it. css :: FilePath -> Hakyll () module Text.Hakyll.Renderables -- | A custom page. data CustomPage -- | Create a custom page. -- -- The association list given maps keys to values for substitution. Note -- that as value, you can either give a String or a Hakyll -- String. A Hakyll String is preferred for more complex -- data, since it allows dependency checking. A String is -- obviously more simple to use in some cases. createCustomPage :: String -> [FilePath] -> [(String, Either String (Hakyll String))] -> CustomPage -- | PagePath is a class that wraps a FilePath. This is used to render -- Pages without reading them first through use of caching. data PagePath -- | Create a PagePath from a FilePath. createPagePath :: FilePath -> PagePath -- | A combination of two other renderables. data CombinedRenderable a b -- | Combine two renderables. The url will always be taken from the first -- Renderable. Also, if a `$key` is present in both renderables, -- the value from the first Renderable will be taken as well. combine :: (Renderable a, Renderable b) => a -> b -> CombinedRenderable a b -- | Combine two renderables and set a custom URL. combineWithURL :: (Renderable a, Renderable b) => FilePath -> a -> b -> CombinedRenderable a b instance (Renderable a, Renderable b) => Renderable (CombinedRenderable a b) instance Renderable PagePath instance Renderable CustomPage -- | Module containing some specialized functions to deal with tags. This -- Module follows certain conventions. Stick with them. module Text.Hakyll.Tags -- | Read a tag map. This creates a map from tags to page paths. This -- function assumes the tags are located in the tags metadata -- field, separated by commas. readTagMap :: [FilePath] -> Hakyll (Map String [FilePath]) -- | Render a tag cloud. renderTagCloud :: Map String [FilePath] -> (String -> String) -> Float -> Float -> String renderTagLinks :: (String -> String) -> ContextManipulation -- | Module containing a small, simple http file server for testing and -- preview purposes. module Network.Hakyll.SimpleServer -- | Start a simple http server on the given PortNumber, serving the -- given directory. simpleServer :: PortNumber -> FilePath -> IO () instance Ord Response instance Eq Response instance Ord Request instance Eq Request instance Show Response instance Show Request module Text.Hakyll -- | Default hakyll configuration. defaultHakyllConfiguration :: HakyllConfiguration -- | Hakyll with a default configuration. hakyll :: Hakyll () -> IO () -- | Main function to run hakyll with a configuration. hakyllWithConfiguration :: HakyllConfiguration -> Hakyll () -> IO ()