-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | A static website compiler library
--   
--   Hakyll is a static website compiler library. It provides you with the
--   tools to create a simple or advanced static website using a Haskell
--   DSL and formats such as markdown or RST. You can find more
--   information, including a tutorial, on the website:
--   
--   
--   
- http://jaspervdj.be/hakyll
--   
--   
--   If you seek assistance, there's:
--   
--   
--   
- A google group: http://groups.google.com/group/hakyll
--   
- An IRC channel, #hakyll on freenode
--   
--   
--   Additionally, there's the Haddock documentation in the different
--   modules, meant as a reference.
@package hakyll
@version 4.7.5.1

-- | Provides utilities to manipulate HTML pages
module Hakyll.Web.Html

-- | Map over all tags in the document
withTags :: (Tag String -> Tag String) -> String -> String

-- | Map every h1 to an h2, h2 to h3,
--   etc.
demoteHeaders :: String -> String
getUrls :: [Tag String] -> [String]

-- | Apply a function to each URL on a webpage
withUrls :: (String -> String) -> String -> String

-- | Convert a filepath to an URL starting from the site root
--   
--   Example:
--   
--   
--   toUrl "foo/bar.html"
--   
--   
--   Result:
--   
--   
--   "/foo/bar.html"
--   
--   
--   This also sanitizes the URL, e.g. converting spaces into '%20'
toUrl :: FilePath -> String

-- | Get the relative url to the site root, for a given (absolute) url
toSiteRoot :: String -> String

-- | Check if an URL links to an external HTTP(S) source
isExternal :: String -> Bool

-- | Strip all HTML tags from a string
--   
--   Example:
--   
--   
--   stripTags "<p>foo</p>"
--   
--   
--   Result:
--   
--   
--   "foo"
--   
--   
--   This also works for incomplete tags
--   
--   Example:
--   
--   
--   stripTags "<p>foo</p"
--   
--   
--   Result:
--   
--   
--   "foo"
--   
stripTags :: String -> String

-- | HTML-escape a string
--   
--   Example:
--   
--   
--   escapeHtml "Me & Dean"
--   
--   
--   Result:
--   
--   
--   "Me &amp; Dean"
--   
escapeHtml :: String -> String

-- | Miscellaneous string manipulation functions.
module Hakyll.Core.Util.String

-- | Trim a string (drop spaces, tabs and newlines at both sides).
trim :: String -> String

-- | A simple (but inefficient) regex replace funcion
replaceAll :: String -> (String -> String) -> String -> String

-- | A simple regex split function. The resulting list will contain no
--   empty strings.
splitAll :: String -> String -> [String]

-- | Find the first instance of needle (must be non-empty) in haystack. We
--   return the prefix of haystack before needle is matched.
--   
--   Examples:
--   
--   
--   needlePrefix "cd" "abcde" = "ab"
--   
--   
--   
--   needlePrefix "ab" "abc" = ""
--   
--   
--   
--   needlePrefix "ab" "xxab" = "xx"
--   
--   
--   
--   needlePrefix "a" "xx" = "xx"
--   
needlePrefix :: String -> String -> Maybe String

-- | An identifier is a type used to uniquely identify an item. An
--   identifier is conceptually similar to a file path. Examples of
--   identifiers are:
--   
--   
--   
- 
posts/foo.markdown

--   
- 
index

--   
- 
error/404

--   
module Hakyll.Core.Identifier
data Identifier

-- | Parse an identifier from a string
fromFilePath :: String -> Identifier

-- | Convert an identifier to a relative FilePath
toFilePath :: Identifier -> FilePath
identifierVersion :: Identifier -> Maybe String
setVersion :: Maybe String -> Identifier -> Identifier
instance GHC.Classes.Ord Hakyll.Core.Identifier.Identifier
instance GHC.Classes.Eq Hakyll.Core.Identifier.Identifier
instance Data.Binary.Class.Binary Hakyll.Core.Identifier.Identifier
instance Data.String.IsString Hakyll.Core.Identifier.Identifier
instance Control.DeepSeq.NFData Hakyll.Core.Identifier.Identifier
instance GHC.Show.Show Hakyll.Core.Identifier.Identifier

-- | As Identifier is used to specify a single item, a
--   Pattern is used to specify a list of items.
--   
--   In most cases, globs are used for patterns.
--   
--   A very simple pattern of such a pattern is "foo/bar". This
--   pattern will only match the exact foo/bar identifier.
--   
--   To match more than one identifier, there are different captures that
--   one can use:
--   
--   
--   
- "*": matches at most one element of an identifier;
--   
- "**": matches one or more elements of an identifier.
--   
--   
--   Some examples:
--   
--   
--   
- "foo/*" will match "foo/bar" and
--   "foo/foo", but not "foo/bar/qux";
--   
- "**" will match any identifier;
--   
- "foo/**" will match "foo/bar" and
--   "foo/bar/qux", but not "bar/foo";
--   
- "foo/*.html" will match all HTML files in the
--   "foo/" directory.
--   
--   
--   The capture function allows the user to get access to the
--   elements captured by the capture elements in the pattern.
module Hakyll.Core.Identifier.Pattern

-- | Type that allows matching on identifiers
data Pattern

-- | Parse a pattern from a string
fromGlob :: String -> Pattern

-- | Create a Pattern from a list of Identifiers it should
--   match.
--   
--   Warning: use this carefully with hasNoVersion and
--   hasVersion. The Identifiers in the list already
--   have versions assigned, and the pattern will then only match the
--   intersection of both versions.
--   
--   A more concrete example,
--   
--   
--   fromList ["foo.markdown"] .&&. hasVersion "pdf"
--   
--   
--   will not match anything! The "foo.markdown" Identifier
--   has no version assigned, so the LHS of .&&. will only
--   match this Identifier with no version. The RHS only matches
--   Identifiers with version set to "pdf" -- hence, this
--   pattern matches nothing.
--   
--   The correct way to use this is:
--   
--   
--   fromList $ map (setVersion $ Just "pdf") ["foo.markdown"]
--   
fromList :: [Identifier] -> Pattern

-- | Create a Pattern from a regex
--   
--   Example:
--   
--   
--   regex "^foo/[^x]*$
--   
fromRegex :: String -> Pattern

-- | Create a pattern which matches all items with the given version.
fromVersion :: Maybe String -> Pattern

-- | Specify a version, e.g.
--   
--   
--   "foo/*.markdown" .&&. hasVersion "pdf"
--   
hasVersion :: String -> Pattern

-- | Match only if the identifier has no version set, e.g.
--   
--   
--   "foo/*.markdown" .&&. hasNoVersion
--   
hasNoVersion :: Pattern

-- | && for patterns: the given identifier must match both
--   subterms
(.&&.) :: Pattern -> Pattern -> Pattern

-- | || for patterns: the given identifier must match any subterm
(.||.) :: Pattern -> Pattern -> Pattern

-- | Inverts a pattern, e.g.
--   
--   
--   complement "foo/bar.html"
--   
--   
--   will match anything except "foo/bar.html"
complement :: Pattern -> Pattern

-- | Check if an identifier matches a pattern
matches :: Pattern -> Identifier -> Bool

-- | Given a list of identifiers, retain only those who match the given
--   pattern
filterMatches :: Pattern -> [Identifier] -> [Identifier]

-- | Match a glob against a pattern, generating a list of captures
capture :: Pattern -> Identifier -> Maybe [String]

-- | Create an identifier from a pattern by filling in the captures with a
--   given string
--   
--   Example:
--   
--   
--   fromCapture (fromGlob "tags/*") "foo"
--   
--   
--   Result:
--   
--   
--   "tags/foo"
--   
fromCapture :: Pattern -> String -> Identifier

-- | Create an identifier from a pattern by filling in the captures with
--   the given list of strings
fromCaptures :: Pattern -> [String] -> Identifier
instance GHC.Show.Show Hakyll.Core.Identifier.Pattern.Pattern
instance GHC.Show.Show Hakyll.Core.Identifier.Pattern.GlobComponent
instance GHC.Classes.Eq Hakyll.Core.Identifier.Pattern.GlobComponent
instance Data.Binary.Class.Binary Hakyll.Core.Identifier.Pattern.GlobComponent
instance Data.Binary.Class.Binary Hakyll.Core.Identifier.Pattern.Pattern
instance Data.String.IsString Hakyll.Core.Identifier.Pattern.Pattern
instance GHC.Base.Monoid Hakyll.Core.Identifier.Pattern.Pattern

module Hakyll.Core.Dependencies
data Dependency
PatternDependency :: Pattern -> (Set Identifier) -> Dependency
IdentifierDependency :: Identifier -> Dependency
type DependencyFacts = Map Identifier [Dependency]
outOfDate :: [Identifier] -> Set Identifier -> DependencyFacts -> (Set Identifier, DependencyFacts, [String])
instance GHC.Show.Show Hakyll.Core.Dependencies.DependencyState
instance GHC.Show.Show Hakyll.Core.Dependencies.Dependency
instance Data.Binary.Class.Binary Hakyll.Core.Dependencies.Dependency

module Hakyll.Core.Metadata
type Metadata = Map String String
class Monad m => MonadMetadata m where getAllMetadata pattern = do { matches' <- getMatches pattern; forM matches' $ \ id' -> do { metadata <- getMetadata id'; return (id', metadata) } }
getMetadata :: MonadMetadata m => Identifier -> m Metadata
getMatches :: MonadMetadata m => Pattern -> m [Identifier]
getAllMetadata :: MonadMetadata m => Pattern -> m [(Identifier, Metadata)]
getMetadataField :: MonadMetadata m => Identifier -> String -> m (Maybe String)

-- | Version of getMetadataField which throws an error if the field
--   does not exist.
getMetadataField' :: MonadMetadata m => Identifier -> String -> m String
makePatternDependency :: MonadMetadata m => Pattern -> m Dependency

-- | Once a target is compiled, the user usually wants to save it to the
--   disk. This is where the Routes type comes in; it determines
--   where a certain target should be written.
--   
--   Suppose we have an item foo/bar.markdown. We can render this
--   to foo/bar.html using:
--   
--   
--   route "foo/bar.markdown" (setExtension ".html")
--   
--   
--   If we do not want to change the extension, we can use idRoute,
--   the simplest route available:
--   
--   
--   route "foo/bar.markdown" idRoute
--   
--   
--   That will route foo/bar.markdown to
--   foo/bar.markdown.
--   
--   Note that the extension says nothing about the content! If you set the
--   extension to .html, it is your own responsibility to ensure
--   that the content is indeed HTML.
--   
--   Finally, some special cases:
--   
--   
--   
- If there is no route for an item, this item will not be routed, so
--   it will not appear in your site directory.
--   
- If an item matches multiple routes, the first rule will be
--   chosen.
--   
module Hakyll.Core.Routes

-- | When you ran a route, it's useful to know whether or not this used
--   metadata. This allows us to do more granular dependency analysis.
type UsedMetadata = Bool

-- | Type used for a route
data Routes

-- | Apply a route to an identifier
runRoutes :: Routes -> Provider -> Identifier -> IO (Maybe FilePath, UsedMetadata)

-- | A route that uses the identifier as filepath. For example, the target
--   with ID foo/bar will be written to the file foo/bar.
idRoute :: Routes

-- | Set (or replace) the extension of a route.
--   
--   Example:
--   
--   
--   runRoutes (setExtension "html") "foo/bar"
--   
--   
--   Result:
--   
--   
--   Just "foo/bar.html"
--   
--   
--   Example:
--   
--   
--   runRoutes (setExtension "html") "posts/the-art-of-trolling.markdown"
--   
--   
--   Result:
--   
--   
--   Just "posts/the-art-of-trolling.html"
--   
setExtension :: String -> Routes

-- | Apply the route if the identifier matches the given pattern, fail
--   otherwise
matchRoute :: Pattern -> Routes -> Routes

-- | Create a custom route. This should almost always be used with
--   matchRoute
customRoute :: (Identifier -> FilePath) -> Routes

-- | A route that always gives the same result. Obviously, you should only
--   use this for a single compilation rule.
constRoute :: FilePath -> Routes

-- | Create a gsub route
--   
--   Example:
--   
--   
--   runRoutes (gsubRoute "rss/" (const "")) "tags/rss/bar.xml"
--   
--   
--   Result:
--   
--   
--   Just "tags/bar.xml"
--   
gsubRoute :: String -> (String -> String) -> Routes

-- | Get access to the metadata in order to determine the route
metadataRoute :: (Metadata -> Routes) -> Routes

-- | Compose routes so that f `composeRoutes` g is more or less
--   equivalent with g . f.
--   
--   Example:
--   
--   
--   let routes = gsubRoute "rss/" (const "") `composeRoutes` setExtension "xml"
--   in runRoutes routes "tags/rss/bar"
--   
--   
--   Result:
--   
--   
--   Just "tags/bar.xml"
--   
--   
--   If the first route given fails, Hakyll will not apply the second
--   route.
composeRoutes :: Routes -> Routes -> Routes
instance GHC.Base.Monoid Hakyll.Core.Routes.Routes

-- | Exports a datastructure for the top-level hakyll configuration
module Hakyll.Core.Configuration
data Configuration
Configuration :: FilePath -> FilePath -> FilePath -> FilePath -> (FilePath -> Bool) -> String -> (Configuration -> IO ExitCode) -> Bool -> String -> Int -> Configuration

-- | Directory in which the output written
[destinationDirectory] :: Configuration -> FilePath

-- | Directory where hakyll's internal store is kept
[storeDirectory] :: Configuration -> FilePath

-- | Directory in which some temporary files will be kept
[tmpDirectory] :: Configuration -> FilePath

-- | Directory where hakyll finds the files to compile. This is .
--   by default.
[providerDirectory] :: Configuration -> FilePath

-- | Function to determine ignored files
--   
--   In defaultConfiguration, the following files are ignored:
--   
--   
--   
- files starting with a .
--   
- files starting with a #
--   
- files ending with a ~
--   
- files ending with .swp
--   
--   
--   Note that the files in destinationDirectory and
--   storeDirectory will also be ignored. Note that this is the
--   configuration parameter, if you want to use the test, you should use
--   shouldIgnoreFile.
[ignoreFile] :: Configuration -> FilePath -> Bool

-- | Here, you can plug in a system command to upload/deploy your site.
--   
--   Example:
--   
--   
--   rsync -ave 'ssh -p 2217' _site jaspervdj@jaspervdj.be:hakyll
--   
--   
--   You can execute this by using
--   
--   
--   ./site deploy
--   
[deployCommand] :: Configuration -> String

-- | Function to deploy the site from Haskell.
--   
--   By default, this command executes the shell command stored in
--   deployCommand. If you override it, deployCommand will
--   not be used implicitely.
--   
--   The Configuration object is passed as a parameter to this
--   function.
[deploySite] :: Configuration -> Configuration -> IO ExitCode

-- | Use an in-memory cache for items. This is faster but uses more memory.
[inMemoryCache] :: Configuration -> Bool

-- | Override default host for preview server. Default is "127.0.0.1",
--   which binds only on the loopback address. One can also override the
--   host as a command line argument: ./site preview -h "0.0.0.0"
[previewHost] :: Configuration -> String

-- | Override default port for preview server. Default is 8000. One can
--   also override the port as a command line argument: ./site preview -p
--   1234
[previewPort] :: Configuration -> Int

-- | Check if a file should be ignored
shouldIgnoreFile :: Configuration -> FilePath -> IO Bool

-- | Default configuration for a hakyll application
defaultConfiguration :: Configuration
instance Data.Default.Class.Default Hakyll.Core.Configuration.Configuration

-- | An item is a combination of some content and its Identifier.
--   This way, we can still use the Identifier to access metadata.
module Hakyll.Core.Item
data Item a
Item :: Identifier -> a -> Item a
[itemIdentifier] :: Item a -> Identifier
[itemBody] :: Item a -> a
itemSetBody :: a -> Item b -> Item a

-- | Perform a compiler action on the item body. This is the same as
--   traverse, but looks less intimidating.
--   
--   
--   withItemBody = traverse
--   
withItemBody :: (a -> Compiler b) -> Item a -> Compiler (Item b)
instance GHC.Show.Show a => GHC.Show.Show (Hakyll.Core.Item.Item a)
instance GHC.Base.Functor Hakyll.Core.Item.Item
instance Data.Foldable.Foldable Hakyll.Core.Item.Item
instance Data.Traversable.Traversable Hakyll.Core.Item.Item
instance Data.Binary.Class.Binary a => Data.Binary.Class.Binary (Hakyll.Core.Item.Item a)

-- | Describes writable items; items that can be saved to the disk
module Hakyll.Core.Writable

-- | Describes an item that can be saved to the disk
class Writable a

-- | Save an item to the given filepath
write :: Writable a => FilePath -> Item a -> IO ()
instance Hakyll.Core.Writable.Writable ()
instance Hakyll.Core.Writable.Writable [GHC.Types.Char]
instance Hakyll.Core.Writable.Writable Data.ByteString.Internal.ByteString
instance Hakyll.Core.Writable.Writable Data.ByteString.Lazy.Internal.ByteString
instance Hakyll.Core.Writable.Writable [GHC.Word.Word8]
instance Hakyll.Core.Writable.Writable Text.Blaze.Html.Html

-- | Module containing the template data structure
module Hakyll.Web.Template.Internal

-- | Datatype used for template substitutions.
newtype Template
Template :: [TemplateElement] -> Template
[unTemplate] :: Template -> [TemplateElement]
newtype TemplateKey
TemplateKey :: String -> TemplateKey

-- | Expression in a template
data TemplateExpr
Ident :: TemplateKey -> TemplateExpr
Call :: TemplateKey -> [TemplateExpr] -> TemplateExpr
StringLiteral :: String -> TemplateExpr

-- | Elements of a template.
data TemplateElement
Chunk :: String -> TemplateElement
Expr :: TemplateExpr -> TemplateElement
Escaped :: TemplateElement
If :: TemplateExpr -> Template -> (Maybe Template) -> TemplateElement
For :: TemplateExpr -> Template -> (Maybe Template) -> TemplateElement
Partial :: TemplateExpr -> TemplateElement
readTemplate :: String -> Template
instance Data.Binary.Class.Binary Hakyll.Web.Template.Internal.Template
instance GHC.Classes.Eq Hakyll.Web.Template.Internal.Template
instance GHC.Show.Show Hakyll.Web.Template.Internal.Template
instance GHC.Classes.Eq Hakyll.Web.Template.Internal.TemplateElement
instance GHC.Show.Show Hakyll.Web.Template.Internal.TemplateElement
instance GHC.Classes.Eq Hakyll.Web.Template.Internal.TemplateExpr
instance GHC.Classes.Eq Hakyll.Web.Template.Internal.TemplateKey
instance GHC.Show.Show Hakyll.Web.Template.Internal.TemplateKey
instance Data.Binary.Class.Binary Hakyll.Web.Template.Internal.TemplateKey
instance Hakyll.Core.Writable.Writable Hakyll.Web.Template.Internal.Template
instance Data.String.IsString Hakyll.Web.Template.Internal.Template
instance Data.String.IsString Hakyll.Web.Template.Internal.TemplateKey
instance Data.Binary.Class.Binary Hakyll.Web.Template.Internal.TemplateElement
instance GHC.Show.Show Hakyll.Web.Template.Internal.TemplateExpr
instance Data.Binary.Class.Binary Hakyll.Web.Template.Internal.TemplateExpr

-- | A module dealing with pandoc file extensions and associated file types
module Hakyll.Web.Pandoc.FileType

-- | Datatype to represent the different file types Hakyll can deal with by
--   default
data FileType
Binary :: FileType
Css :: FileType
DocBook :: FileType
Html :: FileType
LaTeX :: FileType
LiterateHaskell :: FileType -> FileType
Markdown :: FileType
MediaWiki :: FileType
OrgMode :: FileType
PlainText :: FileType
Rst :: FileType
Textile :: FileType

-- | Get the file type for a certain file. The type is determined by
--   extension.
fileType :: FilePath -> FileType

-- | Get the file type for the current file
itemFileType :: Item a -> FileType
instance GHC.Read.Read Hakyll.Web.Pandoc.FileType.FileType
instance GHC.Show.Show Hakyll.Web.Pandoc.FileType.FileType
instance GHC.Classes.Ord Hakyll.Web.Pandoc.FileType.FileType
instance GHC.Classes.Eq Hakyll.Web.Pandoc.FileType.FileType

-- | This module provides a declarative DSL in which the user can specify
--   the different rules used to run the compilers.
--   
--   The convention is to just list all items in the Rules monad,
--   routes and compilation rules.
--   
--   A typical usage example would be:
--   
--   
--   main = hakyll $ do
--       match "posts/*" $ do
--           route   (setExtension "html")
--           compile someCompiler
--       match "css/*" $ do
--           route   idRoute
--           compile compressCssCompiler
--   
module Hakyll.Core.Rules

-- | The monad used to compose rules
data Rules a
match :: Pattern -> Rules () -> Rules ()
matchMetadata :: Pattern -> (Metadata -> Bool) -> Rules () -> Rules ()
create :: [Identifier] -> Rules () -> Rules ()
version :: String -> Rules () -> Rules ()

-- | Add a compilation rule to the rules.
--   
--   This instructs all resources to be compiled using the given compiler.
compile :: (Binary a, Typeable a, Writable a) => Compiler (Item a) -> Rules ()

-- | Add a route.
--   
--   This adds a route for all items matching the current pattern.
route :: Routes -> Rules ()

-- | Execute an IO action immediately while the rules are being
--   evaluated. This should be avoided if possible, but occasionally comes
--   in useful.
preprocess :: IO a -> Rules a
data Dependency
PatternDependency :: Pattern -> (Set Identifier) -> Dependency
IdentifierDependency :: Identifier -> Dependency

-- | Advanced usage: add extra dependencies to compilers. Basically this is
--   needed when you're doing unsafe tricky stuff in the rules monad, but
--   you still want correct builds.
--   
--   A useful utility for this purpose is makePatternDependency.
rulesExtraDependencies :: [Dependency] -> Rules a -> Rules a

-- | Module providing the main hakyll function and command-line argument
--   parsing
module Hakyll.Main

-- | This usualy is the function with which the user runs the hakyll
--   compiler
hakyll :: Rules a -> IO ()

-- | A variant of hakyll which allows the user to specify a custom
--   configuration
hakyllWith :: Configuration -> Rules a -> IO ()
hakyllWithExitCode :: Configuration -> Rules a -> IO ExitCode
instance GHC.Show.Show Hakyll.Main.HakyllArgs
instance Data.Data.Data Hakyll.Main.HakyllArgs

module Hakyll.Core.Compiler

-- | A monad which lets you compile items and takes care of dependency
--   tracking for you.
data Compiler a

-- | Get the underlying identifier.
getUnderlying :: Compiler Identifier

-- | Get the extension of the underlying identifier. Returns something like
--   ".html"
getUnderlyingExtension :: Compiler String
makeItem :: a -> Compiler (Item a)

-- | Get the route for a specified item
getRoute :: Identifier -> Compiler (Maybe FilePath)

-- | Get the full contents of the matched source file as a string, but
--   without metadata preamble, if there was one.
getResourceBody :: Compiler (Item String)

-- | Get the full contents of the matched source file as a string.
getResourceString :: Compiler (Item String)

-- | Get the full contents of the matched source file as a lazy bytestring.
getResourceLBS :: Compiler (Item ByteString)

-- | Get the file path of the resource we are compiling
getResourceFilePath :: Compiler FilePath

-- | Whilst compiling an item, it possible to save multiple snapshots of
--   it, and not just the final result.
type Snapshot = String

-- | Save a snapshot of the item. This function returns the same item,
--   which convenient for building >>= chains.
saveSnapshot :: (Binary a, Typeable a) => Snapshot -> Item a -> Compiler (Item a)

-- | Load an item compiled elsewhere. If the required item is not yet
--   compiled, the build system will take care of that automatically.
load :: (Binary a, Typeable a) => Identifier -> Compiler (Item a)

-- | Require a specific snapshot of an item.
loadSnapshot :: (Binary a, Typeable a) => Identifier -> Snapshot -> Compiler (Item a)

-- | A shortcut for only requiring the body of an item.
--   
--   
--   loadBody = fmap itemBody . load
--   
loadBody :: (Binary a, Typeable a) => Identifier -> Compiler a
loadSnapshotBody :: (Binary a, Typeable a) => Identifier -> Snapshot -> Compiler a

-- | This function allows you to load a dynamic list of items
loadAll :: (Binary a, Typeable a) => Pattern -> Compiler [Item a]
loadAllSnapshots :: (Binary a, Typeable a) => Pattern -> Snapshot -> Compiler [Item a]
cached :: (Binary a, Typeable a) => String -> Compiler a -> Compiler a
unsafeCompiler :: IO a -> Compiler a

-- | Compiler for debugging purposes
debugCompiler :: String -> Compiler ()

-- | Exports simple compilers to just copy files
module Hakyll.Core.File

-- | This will copy any file directly by using a system call
newtype CopyFile
CopyFile :: FilePath -> CopyFile
copyFileCompiler :: Compiler (Item CopyFile)
newtype TmpFile
TmpFile :: FilePath -> TmpFile

-- | Create a tmp file
newTmpFile :: String -> Compiler TmpFile
instance GHC.Show.Show Hakyll.Core.File.CopyFile
instance GHC.Classes.Ord Hakyll.Core.File.CopyFile
instance GHC.Classes.Eq Hakyll.Core.File.CopyFile
instance Data.Binary.Class.Binary Hakyll.Core.File.CopyFile
instance Hakyll.Core.Writable.Writable Hakyll.Core.File.CopyFile
instance Data.Binary.Class.Binary Hakyll.Core.File.TmpFile
instance Hakyll.Core.Writable.Writable Hakyll.Core.File.TmpFile

-- | A Compiler that supports unix filters.
module Hakyll.Core.UnixFilter

-- | Use a unix filter as compiler. For example, we could use the
--   rev program as a compiler.
--   
--   
--   rev :: Compiler String
--   rev = getResourceString >>= withItemBody (unixFilter "rev" [])
--   
--   
--   A more realistic example: one can use this to call, for example, the
--   sass compiler on CSS files. More information about sass can be found
--   here:
--   
--   http://sass-lang.com/
--   
--   The code is fairly straightforward, given that we use .scss
--   for sass:
--   
--   
--   match "style.scss" $ do
--       route   $ setExtension "css"
--       compile $ getResourceString >>=
--           withItemBody (unixFilter "sass" ["-s", "--scss"]) >>=
--           return . fmap compressCss
--   
unixFilter :: String -> [String] -> String -> Compiler String

-- | Variant of unixFilter that should be used for binary files
--   
--   
--   match "music.wav" $ do
--       route   $ setExtension "ogg"
--       compile $ getResourceLBS >>= withItemBody (unixFilterLBS "oggenc" ["-"])
--   
unixFilterLBS :: String -> [String] -> ByteString -> Compiler ByteString

-- | Module used for CSS compression. The compression is currently in a
--   simple state, but would typically reduce the number of bytes by about
--   25%.
module Hakyll.Web.CompressCss

-- | Compiler form of compressCss
compressCssCompiler :: Compiler (Item String)

-- | Compress CSS to speed up your site.
compressCss :: String -> String

-- | This module exposes a function which can relativize URL's on a
--   webpage.
--   
--   This means that one can deploy the resulting site on
--   http://example.com/, but also on
--   http://example.com/some-folder/ without having to change
--   anything (simply copy over the files).
--   
--   To use it, you should use absolute URL's from the site root
--   everywhere. For example, use
--   
--   
--   <img src="/images/lolcat.png" alt="Funny zomgroflcopter" />
--   
--   
--   in a blogpost. When running this through the relativize URL's module,
--   this will result in (suppose your blogpost is located at
--   /posts/foo.html:
--   
--   
--   <img src="../images/lolcat.png" alt="Funny zomgroflcopter" />
--   
module Hakyll.Web.Html.RelativizeUrls

-- | Compiler form of relativizeUrls which automatically picks the
--   right root path
relativizeUrls :: Item String -> Compiler (Item String)

-- | Relativize URL's in HTML
relativizeUrlsWith :: String -> String -> String

-- | Module exporting convenient pandoc bindings
module Hakyll.Web.Pandoc

-- | Read a string using pandoc, with the default options
readPandoc :: Item String -> Compiler (Item Pandoc)

-- | Read a string using pandoc, with the supplied options
readPandocWith :: ReaderOptions -> Item String -> Compiler (Item Pandoc)

-- | Write a document (as HTML) using pandoc, with the default options
writePandoc :: Item Pandoc -> Item String

-- | Write a document (as HTML) using pandoc, with the supplied options
writePandocWith :: WriterOptions -> Item Pandoc -> Item String

-- | Render the resource using pandoc
renderPandoc :: Item String -> Compiler (Item String)

-- | Render the resource using pandoc
renderPandocWith :: ReaderOptions -> WriterOptions -> Item String -> Compiler (Item String)

-- | Read a page render using pandoc
pandocCompiler :: Compiler (Item String)

-- | A version of pandocCompiler which allows you to specify your
--   own pandoc options
pandocCompilerWith :: ReaderOptions -> WriterOptions -> Compiler (Item String)

-- | An extension of pandocCompilerWith which allows you to specify
--   a custom pandoc transformation for the content
pandocCompilerWithTransform :: ReaderOptions -> WriterOptions -> (Pandoc -> Pandoc) -> Compiler (Item String)

-- | Similar to pandocCompilerWithTransform, but the transformation
--   function is monadic. This is useful when you want the pandoc
--   transformation to use the Compiler information such as routes,
--   metadata, etc
pandocCompilerWithTransformM :: ReaderOptions -> WriterOptions -> (Pandoc -> Compiler Pandoc) -> Compiler (Item String)

-- | The default reader options for pandoc parsing in hakyll
defaultHakyllReaderOptions :: ReaderOptions

-- | The default writer options for pandoc rendering in hakyll
defaultHakyllWriterOptions :: WriterOptions

-- | Wraps pandocs bibiliography handling
--   
--   In order to add a bibliography, you will need a bibliography file
--   (e.g. .bib) and a CSL file (.csl). Both need to be
--   compiled with their respective compilers (biblioCompiler and
--   cslCompiler). Then, you can refer to these files when you use
--   readPandocBiblio. This function also takes the reader options
--   for completeness -- you can use defaultHakyllReaderOptions if
--   you're unsure. pandocBiblioCompiler is a convenience wrapper
--   which works like pandocCompiler, but also takes paths to
--   compiled bibliography and csl files.
module Hakyll.Web.Pandoc.Biblio
data CSL
cslCompiler :: Compiler (Item CSL)
newtype Biblio
Biblio :: [Reference] -> Biblio
biblioCompiler :: Compiler (Item Biblio)
readPandocBiblio :: ReaderOptions -> Item CSL -> Item Biblio -> (Item String) -> Compiler (Item Pandoc)
pandocBiblioCompiler :: String -> String -> Compiler (Item String)
instance GHC.Show.Show Hakyll.Web.Pandoc.Biblio.Biblio
instance GHC.Show.Show Hakyll.Web.Pandoc.Biblio.CSL
instance Data.Binary.Class.Binary Hakyll.Web.Pandoc.Biblio.CSL
instance Hakyll.Core.Writable.Writable Hakyll.Web.Pandoc.Biblio.CSL
instance Data.Binary.Class.Binary Hakyll.Web.Pandoc.Biblio.Biblio
instance Hakyll.Core.Writable.Writable Hakyll.Web.Pandoc.Biblio.Biblio

module Hakyll.Web.Template.Context

-- | Mostly for internal usage
data ContextField
StringField :: String -> ContextField
ListField :: (Context a) -> [Item a] -> ContextField

-- | The Context monoid. Please note that the order in which you
--   compose the items is important. For example in
--   
--   
--   field "A" f1 <> field "A" f2
--   
--   
--   the first context will overwrite the second. This is especially
--   important when something is being composed with metadataField
--   (or defaultContext). If you want your context to be overwritten
--   by the metadata fields, compose it from the right:
--   
--   
--   metadataField <> field "date" fDate
--   
newtype Context a
Context :: (String -> [String] -> Item a -> Compiler ContextField) -> Context a
[unContext] :: Context a -> String -> [String] -> Item a -> Compiler ContextField

-- | Constructs a new field in the 'Context.'
field :: String -> (Item a -> Compiler String) -> Context a

-- | Creates a field to use with the $if()$ template macro.
boolField :: String -> (Item a -> Bool) -> Context a

-- | Creates a field that does not depend on the Item
constField :: String -> String -> Context a
listField :: String -> Context a -> Compiler [Item a] -> Context b
listFieldWith :: String -> Context a -> (Item b -> Compiler [Item a]) -> Context b
functionField :: String -> ([String] -> Item a -> Compiler String) -> Context a
mapContext :: (String -> String) -> Context a -> Context a

-- | A context that contains (in that order)
--   
--   
--   
- A $body$ field
--   
- Metadata fields
--   
- A $url$ urlField
--   
- A $path$ pathField
--   
- A $title$ titleField
--   
defaultContext :: Context String

-- | Constructs a field that contains the body of the item.
bodyField :: String -> Context String

-- | Map any field to its metadata value, if present
metadataField :: Context a

-- | Absolute url to the resulting item
urlField :: String -> Context a

-- | Filepath of the underlying file of the item
pathField :: String -> Context a

-- | This title field takes the basename of the underlying file by
--   default
titleField :: String -> Context a

-- | When the metadata has a field called published in one of the
--   following formats then this function can render the date.
--   
--   
--   
- 
Mon, 06 Sep 2010 00:01:00 +0000

--   
- 
Mon, 06 Sep 2010 00:01:00 UTC

--   
- 
Mon, 06 Sep 2010 00:01:00

--   
- 
2010-09-06T00:01:00+0000

--   
- 
2010-09-06T00:01:00Z

--   
- 
2010-09-06T00:01:00

--   
- 
2010-09-06 00:01:00+0000

--   
- 
2010-09-06 00:01:00

--   
- 
September 06, 2010 00:01 AM

--   
--   
--   Following date-only formats are supported too (00:00:00 for
--   time is assumed)
--   
--   
--   
- 
2010-09-06

--   
- 
September 06, 2010

--   
--   
--   Alternatively, when the metadata has a field called path in a
--   folder/yyyy-mm-dd-title.extension format (the convention for
--   pages) and no published metadata field set, this function can
--   render the date. This pattern matches the file name or directory names
--   that begins with yyyy-mm-dd . For example:
--   folder/yyyy-mm-dd-titledist/main.extension . In
--   case of multiple matches, the rightmost one is used.
dateField :: String -> String -> Context a

-- | This is an extended version of dateField that allows you to
--   specify a time locale that is used for outputting the date. For more
--   details, see dateField.
dateFieldWith :: TimeLocale -> String -> String -> Context a

-- | Parser to try to extract and parse the time from the
--   published field or from the filename. See dateField
--   for more information. Exported for user convenience.
getItemUTC :: MonadMetadata m => TimeLocale -> Identifier -> m UTCTime

-- | Get the time on which the actual file was last modified. This only
--   works if there actually is an underlying file, of couse.
getItemModificationTime :: Identifier -> Compiler UTCTime
modificationTimeField :: String -> String -> Context a
modificationTimeFieldWith :: TimeLocale -> String -> String -> Context a

-- | A context with "teaser" key which contain a teaser of the item. The
--   item is loaded from the given snapshot (which should be saved in the
--   user code before any templates are applied).
teaserField :: String -> Snapshot -> Context String

-- | A context with "teaser" key which contain a teaser of the item,
--   defined as the snapshot content before the teaser separator. The item
--   is loaded from the given snapshot (which should be saved in the user
--   code before any templates are applied).
teaserFieldWithSeparator :: String -> String -> Snapshot -> Context String
missingField :: Context a
instance GHC.Base.Monoid (Hakyll.Web.Template.Context.Context a)

-- | This module containing some specialized functions to deal with tags.
--   It assumes you follow some conventions.
--   
--   We support two types of tags: tags and categories.
--   
--   To use default tags, use buildTags. Tags are placed in a
--   comma-separated metadata field like this:
--   
--   
--   ---
--   author: Philip K. Dick
--   title: Do androids dream of electric sheep?
--   tags: future, science fiction, humanoid
--   ---
--   The novel is set in a post-apocalyptic near future, where the Earth and
--   its populations have been damaged greatly by Nuclear...
--   
--   
--   To use categories, use the buildCategories function. Categories
--   are determined by the directory a page is in, for example, the post
--   
--   
--   posts/coding/2010-01-28-hakyll-categories.markdown
--   
--   
--   will receive the coding category.
--   
--   Advanced users may implement custom systems using buildTagsWith
--   if desired.
--   
--   In the above example, we would want to create a page which lists all
--   pages in the coding category, for example, with the
--   Identifier:
--   
--   
--   tags/coding.html
--   
--   
--   This is where the first parameter of buildTags and
--   buildCategories comes in. In the above case, we used the
--   function:
--   
--   
--   fromCapture "tags/*.html" :: String -> Identifier
--   
--   
--   The tagsRules function lets you generate such a page for each
--   tag in the Rules monad.
module Hakyll.Web.Tags

-- | Data about tags
data Tags
Tags :: [(String, [Identifier])] -> (String -> Identifier) -> Dependency -> Tags
[tagsMap] :: Tags -> [(String, [Identifier])]
[tagsMakeId] :: Tags -> String -> Identifier
[tagsDependency] :: Tags -> Dependency

-- | Obtain tags from a page in the default way: parse them from the
--   tags metadata field.
getTags :: MonadMetadata m => Identifier -> m [String]

-- | Higher-order function to read tags
buildTagsWith :: MonadMetadata m => (Identifier -> m [String]) -> Pattern -> (String -> Identifier) -> m Tags
buildTags :: MonadMetadata m => Pattern -> (String -> Identifier) -> m Tags
buildCategories :: MonadMetadata m => Pattern -> (String -> Identifier) -> m Tags
tagsRules :: Tags -> (String -> Pattern -> Rules ()) -> Rules ()

-- | Render tags in HTML (the flexible higher-order function)
renderTags :: (String -> String -> Int -> Int -> Int -> String) -> ([String] -> String) -> Tags -> Compiler String

-- | Render a tag cloud in HTML
renderTagCloud :: Double -> Double -> Tags -> Compiler String

-- | Render a tag cloud in HTML
renderTagCloudWith :: (Double -> Double -> String -> String -> Int -> Int -> Int -> String) -> ([String] -> String) -> Double -> Double -> Tags -> Compiler String

-- | Render a tag cloud in HTML as a context
tagCloudField :: String -> Double -> Double -> Tags -> Context a

-- | Render a tag cloud in HTML as a context
tagCloudFieldWith :: String -> (Double -> Double -> String -> String -> Int -> Int -> Int -> String) -> ([String] -> String) -> Double -> Double -> Tags -> Context a

-- | Render a simple tag list in HTML, with the tag count next to the item
--   TODO: Maybe produce a Context here
renderTagList :: Tags -> Compiler (String)

-- | Render tags with links
tagsField :: String -> Tags -> Context a

-- | Render tags with links with custom functions to get tags and to render
--   links
tagsFieldWith :: (Identifier -> Compiler [String]) -> (String -> (Maybe FilePath) -> Maybe Html) -> ([Html] -> Html) -> String -> Tags -> Context a

-- | Render the category in a link
categoryField :: String -> Tags -> Context a

-- | Sort tags using supplied function. First element of the tuple passed
--   to the comparing function is the actual tag name.
sortTagsBy :: ((String, [Identifier]) -> (String, [Identifier]) -> Ordering) -> Tags -> Tags

-- | Sample sorting function that compares tags case insensitively.
caseInsensitiveTags :: (String, [Identifier]) -> (String, [Identifier]) -> Ordering
instance GHC.Show.Show Hakyll.Web.Tags.Tags

module Hakyll.Web.Paginate
type PageNumber = Int

-- | Data about paginators
data Paginate
Paginate :: Map PageNumber [Identifier] -> (PageNumber -> Identifier) -> Dependency -> Paginate
[paginateMap] :: Paginate -> Map PageNumber [Identifier]
[paginateMakeId] :: Paginate -> PageNumber -> Identifier
[paginateDependency] :: Paginate -> Dependency
buildPaginateWith :: MonadMetadata m => ([Identifier] -> m [[Identifier]]) -> Pattern -> (PageNumber -> Identifier) -> m Paginate
paginateEvery :: Int -> [a] -> [[a]]
paginateRules :: Paginate -> (PageNumber -> Pattern -> Rules ()) -> Rules ()

-- | A default paginate context which provides the following keys:
paginateContext :: Paginate -> PageNumber -> Context a
instance GHC.Show.Show Hakyll.Web.Paginate.Paginate

-- | This module provides means for reading and applying Templates.
--   
--   Templates are tools to convert items into a string. They are perfectly
--   suited for laying out your site.
--   
--   Let's look at an example template:
--   
--   
--   <html>
--       <head>
--           <title>My crazy homepage - $title$</title>
--       </head>
--       <body>
--           <div id="header">
--               <h1>My crazy homepage - $title$</h1>
--           </div>
--           <div id="content">
--               $body$
--           </div>
--           <div id="footer">
--               By reading this you agree that I now own your soul
--           </div>
--       </body>
--   </html>
--   
--   
--   As you can see, the format is very simple -- $key$ is used to
--   render the $key$ field from the page, everything else is
--   literally copied. If you want to literally insert "$key$"
--   into your page (for example, when you're writing a Hakyll tutorial)
--   you can use
--   
--   
--   <p>
--       A literal $$key$$.
--   </p>
--   
--   
--   Because of it's simplicity, these templates can be used for more than
--   HTML: you could make, for example, CSS or JS templates as well.
--   
--   Apart from interpolating $key$s from the Context you
--   can also use the following macros:
--   
--   
--   
- 
$if(key)$

--   
--   
--   
--   $if(key)$
--    <b> Defined </b>
--   $else$
--    <b> Non-defined </b>
--   $endif$
--   
--   
--   This example will print Defined if key is defined in
--   the context and Non-defined otherwise. The $else$
--   clause is optional.
--   
--   
--   
- 
$for(key)$

--   
--   
--   The for macro is used for enumerating Context elements
--   that are lists, i.e. constructed using the listField function.
--   Assume that in a context we have an element listField "key" c
--   itms. Then the snippet
--   
--   
--   $for(key)$
--     $x$
--   $sep$,
--   $endfor$
--   
--   
--   would, for each item i in itms, lookup $x$
--   in the context c with item i, interpolate it, and
--   join the resulting list with ,.
--   
--   Another concrete example one may consider is the following. Given the
--   context
--   
--   
--   listField "things" (field "thing" (return . itemBody))
--      (sequence [makeItem "fruits", makeItem "vegetables"])
--   
--   
--   and a template
--   
--   
--   I like
--   $for(things)$
--     fresh $thing$$sep$, and 
--   $endfor$
--   
--   
--   the resulting page would look like
--   
--   
--   <p>
--    I like
--   
--     fresh fruits, and 
--   
--     fresh vegetables
--   </p>
--   
--   
--   The $sep$ part can be omitted. Usually, you can get by using
--   the applyListTemplate and applyJoinListTemplate
--   functions.
--   
--   
--   
- 
$partial(path)$

--   
--   
--   Loads a template located in a separate file and interpolates it under
--   the current context.
--   
--   Assuming that the file test.html contains
--   
--   
--   <b>$key$</b>
--   
--   
--   The result of rendering
--   
--   
--   <p>
--     $partial("test.html")$
--   </p>
--   
--   
--   is the same as the result of rendering
--   
--   
--   <p>
--     <b>$key$</b>
--   </p>
--   
--   
--   That is, calling $partial$ is equivalent to just copying and
--   pasting template code.
module Hakyll.Web.Template

-- | Datatype used for template substitutions.
data Template

-- | Read a template.
templateCompiler :: Compiler (Item Template)
applyTemplate :: Template -> Context a -> Item a -> Compiler (Item String)

-- | The following pattern is so common:
--   
--   
--   tpl <- loadBody "templates/foo.html"
--   someCompiler
--       >>= applyTemplate tpl context
--   
--   
--   That we have a single function which does this:
--   
--   
--   someCompiler
--       >>= loadAndApplyTemplate "templates/foo.html" context
--   
loadAndApplyTemplate :: Identifier -> Context a -> Item a -> Compiler (Item String)

-- | It is also possible that you want to substitute $key$s within
--   the body of an item. This function does that by interpreting the item
--   body as a template, and then applying it to itself.
applyAsTemplate :: Context String -> Item String -> Compiler (Item String)
readTemplate :: String -> Template

-- | Provides an easy way to combine several items in a list. The
--   applications are obvious:
--   
--   
--   
- A post list on a blog
--   
- An image list in a gallery
--   
- A sitemap
--   
module Hakyll.Web.Template.List

-- | Generate a string of a listing of pages, after applying a template to
--   each page.
applyTemplateList :: Template -> Context a -> [Item a] -> Compiler String

-- | Join a listing of pages with a string in between, after applying a
--   template to each page.
applyJoinTemplateList :: String -> Template -> Context a -> [Item a] -> Compiler String

-- | Sort pages chronologically. Uses the same method as dateField
--   for extracting the date.
chronological :: MonadMetadata m => [Item a] -> m [Item a]

-- | The reverse of chronological
recentFirst :: MonadMetadata m => [Item a] -> m [Item a]

-- | Version of chronological which doesn't need the actual items.
sortChronological :: MonadMetadata m => [Identifier] -> m [Identifier]

-- | Version of recentFirst which doesn't need the actual items.
sortRecentFirst :: MonadMetadata m => [Identifier] -> m [Identifier]

-- | A Module that allows easy rendering of RSS feeds.
--   
--   The main rendering functions (renderRss, renderAtom)
--   all assume that you pass the list of items so that the most recent
--   entry in the feed is the first item in the list.
--   
--   Also note that the context should have (at least) the following fields
--   to produce a correct feed:
--   
--   
--   
- $title$: Title of the item
--   
- $description$: Description to appear in the feed
--   
- $url$: URL to the item - this is usually set
--   automatically.
--   
--   
--   In addition, the posts should be named according to the rules for
--   dateField
module Hakyll.Web.Feed

-- | This is a data structure to keep the configuration of a feed.
data FeedConfiguration
FeedConfiguration :: String -> String -> String -> String -> String -> FeedConfiguration

-- | Title of the feed.
[feedTitle] :: FeedConfiguration -> String

-- | Description of the feed.
[feedDescription] :: FeedConfiguration -> String

-- | Name of the feed author.
[feedAuthorName] :: FeedConfiguration -> String

-- | Email of the feed author.
[feedAuthorEmail] :: FeedConfiguration -> String

-- | Absolute root URL of the feed site (e.g.
--   http://jaspervdj.be)
[feedRoot] :: FeedConfiguration -> String

-- | Render an RSS feed with a number of items.
renderRss :: FeedConfiguration -> Context String -> [Item String] -> Compiler (Item String)

-- | Render an Atom feed with a number of items.
renderAtom :: FeedConfiguration -> Context String -> [Item String] -> Compiler (Item String)
instance GHC.Classes.Eq Hakyll.Web.Feed.FeedConfiguration
instance GHC.Show.Show Hakyll.Web.Feed.FeedConfiguration

-- | Top-level module exporting all modules that are interesting for the
--   user
module Hakyll

-- | Given a path to a file, try to make the path writable by making all
--   directories on the path.
makeDirectories :: FilePath -> IO ()

-- | Get all contents of a directory.
getRecursiveContents :: (FilePath -> IO Bool) -> FilePath -> IO [FilePath]
removeDirectory :: FilePath -> IO ()
