-- 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.13.4.0

-- | 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 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 :: FilePath -> 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

-- | Produce pretty, thread-safe logs
module Hakyll.Core.Logger
data Verbosity
Error :: Verbosity
Message :: Verbosity
Debug :: Verbosity

-- | Logger structure. Very complicated.
data Logger

-- | Create a new logger
new :: Verbosity -> IO Logger

-- | Flush the logger (blocks until flushed)
flush :: Logger -> IO ()
error :: MonadIO m => Logger -> String -> m ()
header :: MonadIO m => Logger -> String -> m ()
message :: MonadIO m => Logger -> String -> m ()
debug :: MonadIO m => Logger -> String -> m ()
instance GHC.Show.Show Hakyll.Core.Logger.Verbosity
instance GHC.Classes.Ord Hakyll.Core.Logger.Verbosity
instance GHC.Classes.Eq Hakyll.Core.Logger.Verbosity

-- | A store for storing and retreiving items
module Hakyll.Core.Store
data Store

-- | Result of a store query
data Result a

-- | Found, result
Found :: a -> Result a

-- | Not found
NotFound :: Result a

-- | Expected, true type
WrongType :: TypeRep -> TypeRep -> Result a

-- | Convert result to Maybe
toMaybe :: Result a -> Maybe a

-- | Initialize the store
new :: Bool -> FilePath -> IO Store

-- | Store an item
set :: (Binary a, Typeable a) => Store -> [String] -> a -> IO ()

-- | Load an item
get :: (Binary a, Typeable a) => Store -> [String] -> IO (Result a)

-- | Strict function
isMember :: Store -> [String] -> IO Bool

-- | Delete an item
delete :: Store -> [String] -> IO ()

-- | Mostly meant for internal usage
hash :: [String] -> String
instance GHC.Classes.Eq a => GHC.Classes.Eq (Hakyll.Core.Store.Result a)
instance GHC.Show.Show a => GHC.Show.Show (Hakyll.Core.Store.Result a)
instance GHC.Show.Show Hakyll.Core.Store.Store

-- | A module containing various file utility functions
module Hakyll.Core.Util.File

-- | 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 ()

-- | 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

-- | Translate native Windows path separators \\ to / if
--   present.
removeWinPathSeparator :: String -> String

-- | 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 a glob or regex 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
infixr 3 .&&.

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

-- | 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 or regex pattern against an identifier, 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 Data.String.IsString Hakyll.Core.Identifier.Pattern.Internal.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 = Object
lookupString :: String -> Metadata -> Maybe String
lookupStringList :: String -> Metadata -> Maybe [String]
class Monad m => MonadMetadata m
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' :: (MonadFail m, MonadMetadata m) => Identifier -> String -> m String
makePatternDependency :: MonadMetadata m => Pattern -> m Dependency

-- | Newtype wrapper for serialization.
newtype BinaryMetadata
BinaryMetadata :: Metadata -> BinaryMetadata
[unBinaryMetadata] :: BinaryMetadata -> Metadata
instance Data.Binary.Class.Binary Hakyll.Core.Metadata.BinaryMetadata
instance Data.Binary.Class.Binary Hakyll.Core.Metadata.BinaryYaml

-- | Internal module to parse metadata
module Hakyll.Core.Provider.Metadata
loadMetadata :: Provider -> Identifier -> IO (Metadata, Maybe String)
parsePage :: String -> Either ParseException (Metadata, String)

-- | Thrown in the IO monad if things go wrong. Provides a nice-ish error
--   message.
data MetadataException
MetadataException :: FilePath -> ParseException -> MetadataException
instance GHC.Exception.Type.Exception Hakyll.Core.Provider.Metadata.MetadataException
instance GHC.Show.Show Hakyll.Core.Provider.Metadata.MetadataException

-- | This module provides an wrapper API around the file system which does
--   some caching.
module Hakyll.Core.Provider

-- | Responsible for retrieving and listing resources
data Provider

-- | Create a resource provider
newProvider :: Store -> (FilePath -> IO Bool) -> FilePath -> IO Provider
resourceList :: Provider -> [Identifier]

-- | Check if a given resource exists
resourceExists :: Provider -> Identifier -> Bool
resourceFilePath :: Provider -> Identifier -> FilePath

-- | A resource is modified if it or its metadata has changed
resourceModified :: Provider -> Identifier -> Bool
resourceModificationTime :: Provider -> Identifier -> UTCTime

-- | Get the raw body of a resource as string
resourceString :: Provider -> Identifier -> IO String

-- | Get the raw body of a resource of a lazy bytestring
resourceLBS :: Provider -> Identifier -> IO ByteString
resourceMetadata :: Provider -> Identifier -> IO Metadata
resourceBody :: Provider -> Identifier -> IO String

-- | 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.Semigroup Hakyll.Core.Routes.Routes
instance GHC.Base.Monoid Hakyll.Core.Routes.Routes

-- | Internally used compiler module
module Hakyll.Core.Compiler.Internal

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

-- | Environment in which a compiler runs
data CompilerRead
CompilerRead :: Configuration -> Identifier -> Provider -> Set Identifier -> Routes -> Store -> Logger -> CompilerRead

-- | Main configuration
[compilerConfig] :: CompilerRead -> Configuration

-- | Underlying identifier
[compilerUnderlying] :: CompilerRead -> Identifier

-- | Resource provider
[compilerProvider] :: CompilerRead -> Provider

-- | List of all known identifiers
[compilerUniverse] :: CompilerRead -> Set Identifier

-- | Site routes
[compilerRoutes] :: CompilerRead -> Routes

-- | Compiler store
[compilerStore] :: CompilerRead -> Store

-- | Logger
[compilerLogger] :: CompilerRead -> Logger
data CompilerWrite
CompilerWrite :: [Dependency] -> Int -> CompilerWrite
[compilerDependencies] :: CompilerWrite -> [Dependency]
[compilerCacheHits] :: CompilerWrite -> Int

-- | Distinguishes reasons in a CompilerError
data CompilerErrors a

-- | One or more exceptions occured during compilation
CompilationFailure :: NonEmpty a -> CompilerErrors a

-- | Absence of any result, most notably in template contexts. May still
--   have error messages.
CompilationNoResult :: [a] -> CompilerErrors a

-- | An intermediate result of a compilation step
data CompilerResult a
CompilerDone :: a -> CompilerWrite -> CompilerResult a
CompilerSnapshot :: Snapshot -> Compiler a -> CompilerResult a
CompilerRequire :: (Identifier, Snapshot) -> Compiler a -> CompilerResult a
CompilerError :: CompilerErrors String -> CompilerResult a

-- | A monad which lets you compile items and takes care of dependency
--   tracking for you.
newtype Compiler a
Compiler :: (CompilerRead -> IO (CompilerResult a)) -> Compiler a
[unCompiler] :: Compiler a -> CompilerRead -> IO (CompilerResult a)

-- | Like unCompiler but treating IO exceptions as
--   CompilerErrors
runCompiler :: Compiler a -> CompilerRead -> IO (CompilerResult a)

-- | Put the result back in a compiler
compilerResult :: CompilerResult a -> Compiler a

-- | Put a CompilerWrite
compilerTell :: CompilerWrite -> Compiler ()

-- | Get the current environment
compilerAsk :: Compiler CompilerRead

-- | Run an IO computation without dependencies in a Compiler
compilerUnsafeIO :: IO a -> Compiler a

-- | Throw errors in the Compiler.
--   
--   If no messages are given, this is considered a
--   CompilationNoResult error. Otherwise, it is treated as a proper
--   compilation failure.
compilerThrow :: [String] -> Compiler a

-- | Put a CompilerError with multiple messages as
--   CompilationNoResult
compilerNoResult :: [String] -> Compiler a

-- | Allows you to recover from CompilerErrors. Uses the same
--   parameter order as catchError so that it can be used infix.
--   
--   
--   c `compilerCatch` f = compilerTry c >>= either f return
--   
compilerCatch :: Compiler a -> (CompilerErrors String -> Compiler a) -> Compiler a

-- | Allows to distinguish CompilerErrors and branch on them with
--   Either
--   
--   
--   compilerTry = (`compilerCatch` return . Left) . fmap Right
--   
compilerTry :: Compiler a -> Compiler (Either (CompilerErrors String) a)

-- | Unwrap a CompilerErrors
compilerErrorMessages :: CompilerErrors a -> [a]

-- | Pass a list of messages with a heading to the debug logger
compilerDebugEntries :: String -> [String] -> Compiler ()
compilerTellDependencies :: [Dependency] -> Compiler ()
compilerTellCacheHits :: Int -> Compiler ()
instance GHC.Base.Functor Hakyll.Core.Compiler.Internal.CompilerErrors
instance GHC.Show.Show Hakyll.Core.Compiler.Internal.CompilerWrite
instance GHC.Base.Functor Hakyll.Core.Compiler.Internal.Compiler
instance GHC.Base.Monad Hakyll.Core.Compiler.Internal.Compiler
instance Control.Monad.Fail.MonadFail Hakyll.Core.Compiler.Internal.Compiler
instance GHC.Base.Applicative Hakyll.Core.Compiler.Internal.Compiler
instance Hakyll.Core.Metadata.MonadMetadata Hakyll.Core.Compiler.Internal.Compiler
instance Control.Monad.Error.Class.MonadError [GHC.Base.String] Hakyll.Core.Compiler.Internal.Compiler
instance GHC.Base.Alternative Hakyll.Core.Compiler.Internal.Compiler
instance GHC.Base.Semigroup Hakyll.Core.Compiler.Internal.CompilerWrite
instance GHC.Base.Monoid Hakyll.Core.Compiler.Internal.CompilerWrite

-- | 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)

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

-- | Create an item from the underlying identifier and a given value.
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

-- | A shortcut for only requiring the body for a specific snapshot of an
--   item
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]

-- | Load a specific snapshot for each of dynamic list of items
loadAllSnapshots :: (Binary a, Typeable a) => Pattern -> Snapshot -> Compiler [Item a]

-- | Turn on caching for a compilation value to avoid recomputing it on
--   subsequent Hakyll runs. The storage key consists of the underlying
--   identifier of the compiled ressource and the given name.
cached :: (Binary a, Typeable a) => String -> Compiler a -> Compiler a

-- | Run an IO computation without dependencies in a Compiler
unsafeCompiler :: IO a -> Compiler a

-- | Compiler for debugging purposes. Passes a message to the debug logger
--   that is printed in verbose mode.
debugCompiler :: String -> Compiler ()

-- | Fail so that it is treated as non-defined in an $if()$
--   branching Hakyll.Web.Template macro, and alternative
--   Contexts are tried
noResult :: String -> Compiler a

-- | Prepend an error line to the error, if there is one. This allows you
--   to add helpful context to error messages.
withErrorMessage :: String -> Compiler a -> Compiler a

-- | 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 (Item 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

-- | 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 Hakyll.Core.Rules.Internal
data RulesRead
RulesRead :: Provider -> [Identifier] -> Maybe String -> RulesRead
[rulesProvider] :: RulesRead -> Provider
[rulesMatches] :: RulesRead -> [Identifier]
[rulesVersion] :: RulesRead -> Maybe String
data RuleSet
RuleSet :: Routes -> [(Identifier, Compiler SomeItem)] -> Set Identifier -> Pattern -> RuleSet

-- | Accumulated routes
[rulesRoutes] :: RuleSet -> Routes

-- | Accumulated compilers
[rulesCompilers] :: RuleSet -> [(Identifier, Compiler SomeItem)]

-- | A set of the actually used files
[rulesResources] :: RuleSet -> Set Identifier

-- | A pattern we can use to check if a file *would* be used. This is
--   needed for the preview server.
[rulesPattern] :: RuleSet -> Pattern
data RulesState
RulesState :: Maybe Routes -> Maybe (Compiler SomeItem) -> RulesState
[rulesRoute] :: RulesState -> Maybe Routes
[rulesCompiler] :: RulesState -> Maybe (Compiler SomeItem)
emptyRulesState :: RulesState

-- | The monad used to compose rules
newtype Rules a
Rules :: RWST RulesRead RuleSet RulesState IO a -> Rules a
[unRules] :: Rules a -> RWST RulesRead RuleSet RulesState IO a

-- | Run a Rules monad, resulting in a RuleSet
runRules :: Rules a -> Provider -> IO RuleSet
instance GHC.Base.Applicative Hakyll.Core.Rules.Internal.Rules
instance GHC.Base.Functor Hakyll.Core.Rules.Internal.Rules
instance Control.Monad.Fail.MonadFail Hakyll.Core.Rules.Internal.Rules
instance GHC.Base.Monad Hakyll.Core.Rules.Internal.Rules
instance Hakyll.Core.Metadata.MonadMetadata Hakyll.Core.Rules.Internal.Rules
instance GHC.Base.Semigroup Hakyll.Core.Rules.Internal.RuleSet
instance GHC.Base.Monoid Hakyll.Core.Rules.Internal.RuleSet

module Hakyll.Core.Runtime
run :: Configuration -> Logger -> Rules a -> IO (ExitCode, RuleSet)

-- | 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

-- | 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 Data.Binary.Class.Binary Hakyll.Core.File.TmpFile
instance Hakyll.Core.Writable.Writable Hakyll.Core.File.TmpFile
instance Hakyll.Core.Writable.Writable Hakyll.Core.File.CopyFile

-- | 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

-- | 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 over all tags (as list) in the document
withTagList :: ([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

-- | 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

-- | 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

-- | 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.Biblio
instance Hakyll.Core.Writable.Writable Hakyll.Web.Pandoc.Biblio.Biblio
instance Data.Binary.Class.Binary Hakyll.Web.Pandoc.Biblio.CSL
instance Hakyll.Core.Writable.Writable Hakyll.Web.Pandoc.Biblio.CSL

-- | Module used for generating HTML redirect pages. This allows renaming
--   pages to avoid breaking existing links without requiring server-side
--   support for formal 301 Redirect error codes
module Hakyll.Web.Redirect

-- | This datatype can be used directly if you want a lower-level interface
--   to generate redirects. For example, if you want to redirect
--   foo.html to bar.jpg, you can use:
--   
--   
--   create ["foo.html"] $ do
--       route idRoute
--       compile $ makeItem $ Redirect "bar.jpg"
--   
data Redirect
Redirect :: String -> Redirect
[redirectTo] :: Redirect -> String

-- | This function exposes a higher-level interface compared to using the
--   Redirect type manually.
--   
--   This creates, using a database mapping broken URLs to working ones,
--   HTML files which will do HTML META tag redirect pages (since, as a
--   static site, we can't use web-server-level 301 redirects, and using JS
--   is gross).
--   
--   This is useful for sending people using old URLs to renamed versions,
--   dealing with common typos etc, and will increase site traffic. Such
--   broken URLs can be found by looking at server logs or by using Google
--   Webmaster Tools. Broken URLs must be valid Haskell strings,
--   non-URL-escaped valid POSIX filenames, and relative links, since they
--   will be defined in a hakyll.hs and during generation, written
--   to disk with the filename corresponding to the broken URLs. (Target
--   URLs can be absolute or relative, but should be URL-escaped.) So
--   broken incoming links like http://www.gwern.net/foo/ which
--   should be http://www.gwern.net/foobar cannot be fixed (since
--   you cannot create a HTML file named "foo/" on disk, as that
--   would be a directory).
--   
--   An example of a valid association list would be:
--   
--   
--   brokenLinks =
--       [ ("projects.html", "http://github.com/gwern")
--       , ("/Black-market archive", "Black-market%20archives")
--       ]
--   
--   
--   In which case the functionality can then be used in main with
--   a line like:
--   
--   
--   version "redirects" $ createRedirects brokenLinks
--   
--   
--   The version is recommended to separate these items from your
--   other pages.
--   
--   The on-disk files can then be uploaded with HTML mimetypes (either
--   explicitly by generating and uploading them separately, by
--   auto-detection of the filetype, or an upload tool defaulting to HTML
--   mimetype, such as calling s3cmd with
--   --default-mime-type=text/html) and will redirect browsers and
--   search engines going to the old/broken URLs.
--   
--   See also
--   https://groups.google.com/d/msg/hakyll/sWc6zxfh-uM/fUpZPsFNDgAJ.
createRedirects :: [(Identifier, String)] -> Rules ()
instance GHC.Show.Show Hakyll.Web.Redirect.Redirect
instance GHC.Classes.Ord Hakyll.Web.Redirect.Redirect
instance GHC.Classes.Eq Hakyll.Web.Redirect.Redirect
instance Data.Binary.Class.Binary Hakyll.Web.Redirect.Redirect
instance Hakyll.Core.Writable.Writable Hakyll.Web.Redirect.Redirect

-- | This module provides Contexts which are used to expand
--   expressions in templates and allow for arbitrary customisation.
--   
--   Templates define a small expression DSL which consists of
--   strings, identifiers and function application. There is no type
--   system, every value is a string and on the top level they get
--   substituted verbatim into the page.
--   
--   For example, you can build a context that contains
--   
--   
--   … <> functionField "concat" (const . concat) <> …
--   
--   
--   which will allow you to use the concat identifier as a
--   function that takes arbitrarily many stings and concatenates them to a
--   new string:
--   
--   
--   $partial(concat("templates/categories/", category))$
--   
--   
--   This will evaluate the category field in the context, then
--   prepend the path, and include the referenced file as a template.
module Hakyll.Web.Template.Context

-- | Mostly for internal usage
data ContextField
EmptyField :: 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 for a Context. If the key matches, the
--   compiler is run and its result is substituted in the template.
--   
--   If the compiler fails, the field will be considered non-existent in an
--   $if()$ macro or ultimately break the template application
--   (unless the key is found in another context when using
--   <>). Use empty or noResult for intentional
--   failures of fields used in $if()$, to distinguish them from
--   exceptions thrown with fail.
field :: String -> (Item a -> Compiler String) -> Context a

-- | Creates a field to use with the $if()$ template macro.
--   Attempting to substitute the field into the template will cause an
--   error.
boolField :: String -> (Item a -> Bool) -> Context a

-- | Creates a field that does not depend on the Item but
--   always yields the same string
constField :: String -> String -> Context a

-- | Creates a list field to be consumed by a $for(…)$ expression.
--   The compiler returns multiple items which are rendered in the loop
--   body with the supplied context.
listField :: String -> Context a -> Compiler [Item a] -> Context b

-- | Creates a list field like listField, but supplies the current
--   page to the compiler.
listFieldWith :: String -> Context a -> (Item b -> Compiler [Item a]) -> Context b

-- | Creates a variadic function field.
--   
--   The function will be called with the dynamically evaluated string
--   arguments from the template as well as the page that is currently
--   rendered.
functionField :: String -> ([String] -> Item a -> Compiler String) -> Context a

-- | Transform the respective string results of all fields in a context.
--   For example,
--   
--   
--   mapContext (++"c") (constField "x" "a" <> constField "y" "b")
--   
--   
--   is equivalent to
--   
--   
--   constField "x" "ac" <> constField "y" "bc"
--   
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

-- | A context that allows snippet inclusion. In processed file, use as:
--   
--   
--   ...
--   $snippet("path/to/snippet/")$
--   ...
--   
--   
--   The contents of the included file will not be interpolated like
--   partial does it.
snippetField :: Context String

-- | 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.
--   
--   As another alternative, if none of the above matches, and the file has
--   a path which contains nested directories specifying a date, then that
--   date will be used. In other words, if the path is of the form
--   **/yyyymmdd/main.extension . As above,
--   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 and formatTime.
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, MonadFail 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

-- | Creates a field with the last modification date of the underlying
--   item.
modificationTimeField :: String -> String -> Context a

-- | Creates a field with the last modification date of the underlying item
--   in a custom localisation format (see formatTime).
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

-- | Constantly reports any field as missing. Mostly for internal usage, it
--   is the last choice in every context used in a template application.
missingField :: Context a
instance GHC.Base.Semigroup (Hakyll.Web.Template.Context.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. This can either be a list or a
--   comma-separated string.
getTags :: MonadMetadata m => Identifier -> m [String]

-- | Obtain category from a page.
getCategory :: 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

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:
--   
--   
--   
- 
firstPageNum

--   
- 
firstPageUrl

--   
- 
previousPageNum

--   
- 
previousPageUrl

--   
- 
nextPageNum

--   
- 
nextPageUrl

--   
- 
lastPageNum

--   
- 
lastPageUrl

--   
- 
currentPageNum

--   
- 
currentPageUrl

--   
- 
numPages

--   
- 
allPages

--   
paginateContext :: Paginate -> PageNumber -> Context a

-- | Module containing the elements used in a template. A template is
--   generally just a list of these elements.
module Hakyll.Web.Template.Internal.Element
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 -> [TemplateElement] -> Maybe [TemplateElement] -> TemplateElement
For :: TemplateExpr -> [TemplateElement] -> Maybe [TemplateElement] -> TemplateElement
Partial :: TemplateExpr -> TemplateElement
TrimL :: TemplateElement
TrimR :: TemplateElement
templateElems :: Parser [TemplateElement]
parseTemplateElemsFile :: FilePath -> String -> Either String [TemplateElement]
instance GHC.Classes.Eq Hakyll.Web.Template.Internal.Element.TemplateElement
instance GHC.Show.Show Hakyll.Web.Template.Internal.Element.TemplateElement
instance GHC.Classes.Eq Hakyll.Web.Template.Internal.Element.TemplateExpr
instance GHC.Classes.Eq Hakyll.Web.Template.Internal.Element.TemplateKey
instance GHC.Show.Show Hakyll.Web.Template.Internal.Element.TemplateKey
instance Data.Binary.Class.Binary Hakyll.Web.Template.Internal.Element.TemplateKey
instance Data.Binary.Class.Binary Hakyll.Web.Template.Internal.Element.TemplateElement
instance GHC.Show.Show Hakyll.Web.Template.Internal.Element.TemplateExpr
instance Data.Binary.Class.Binary Hakyll.Web.Template.Internal.Element.TemplateExpr
instance Data.String.IsString Hakyll.Web.Template.Internal.Element.TemplateKey

-- | Module for trimming whitespace from tempaltes.
module Hakyll.Web.Template.Internal.Trim
trim :: [TemplateElement] -> [TemplateElement]

module Hakyll.Web.Template.Internal

-- | Datatype used for template substitutions.
data Template
Template :: [TemplateElement] -> FilePath -> Template
[tplElements] :: Template -> [TemplateElement]
[tplOrigin] :: Template -> FilePath

-- | Wrap the constructor to ensure trim is called.
template :: FilePath -> [TemplateElement] -> Template

-- | Read a template, without metadata header
templateBodyCompiler :: Compiler (Item Template)

-- | Read complete file contents as a template
templateCompiler :: Compiler (Item Template)

-- | Interpolate template expressions from context values in a page
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)

-- | Parse a string into a template. You should prefer
--   compileTemplateItem over this.

-- | Deprecated: Use templateCompiler instead
readTemplate :: String -> Template

-- | Parse an item body into a template. Provides useful error messages in
--   the Compiler monad.
compileTemplateItem :: Item String -> Compiler Template

-- | Deprecated: Use templateCompiler
unsafeReadTemplateFile :: FilePath -> Compiler Template
instance Data.Binary.Class.Binary Hakyll.Web.Template.Internal.Template
instance GHC.Generics.Generic Hakyll.Web.Template.Internal.Template
instance GHC.Classes.Eq Hakyll.Web.Template.Internal.Template
instance GHC.Show.Show Hakyll.Web.Template.Internal.Template
instance Hakyll.Core.Writable.Writable Hakyll.Web.Template.Internal.Template
instance Data.String.IsString Hakyll.Web.Template.Internal.Template

-- | 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.
--   
--   In the examples above you can see that the outputs contain a lot of
--   leftover whitespace that you may wish to remove. Using
--   $- or -$ instead of
--   $ in a macro strips all whitespace to the left or
--   right of that clause respectively. Given the context
--   
--   
--   listField "counts" (field "count" (return . itemBody))
--      (sequence [makeItem "3", makeItem "2", makeItem "1"])
--   
--   
--   and a template
--   
--   
--   <p>
--       $for(counts)-$
--         $count$
--         $-sep$...
--       $-endfor$
--   </p>
--   
--   
--   the resulting page would look like
--   
--   
--   <p>
--       3...2...1
--   </p>
--   
module Hakyll.Web.Template

-- | Datatype used for template substitutions.
data Template

-- | Read a template, without metadata header
templateBodyCompiler :: Compiler (Item Template)

-- | Read complete file contents as a template
templateCompiler :: Compiler (Item Template)

-- | Interpolate template expressions from context values in a page
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)

-- | Parse a string into a template. You should prefer
--   compileTemplateItem over this.

-- | Deprecated: Use templateCompiler instead
readTemplate :: String -> Template

-- | Parse an item body into a template. Provides useful error messages in
--   the Compiler monad.
compileTemplateItem :: Item String -> Compiler Template

-- | Deprecated: Use templateCompiler
unsafeReadTemplateFile :: FilePath -> Compiler Template

-- | Embed template allows you embed a template within the Haskell binary.
--   Example:
--   
--   
--   myTemplate :: Template
--   myTemplate = $(embedTemplate "test.html")
--   
embedTemplate :: FilePath -> Q Exp

-- | 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, MonadFail m) => [Item a] -> m [Item a]

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

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

-- | Version of recentFirst which doesn't need the actual items.
sortRecentFirst :: (MonadMetadata m, MonadFail 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)

-- | Render an RSS feed using given templates with a number of items.
renderRssWithTemplates :: Template -> Template -> FeedConfiguration -> Context String -> [Item String] -> Compiler (Item String)

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

-- | Implementation of Hakyll commands: build, preview...
module Hakyll.Commands
data Check
All :: Check
InternalLinks :: Check

-- | Build the site
build :: Configuration -> Logger -> Rules a -> IO ExitCode

-- | Run the checker and exit
check :: Configuration -> Logger -> Check -> IO ExitCode

-- | Remove the output directories
clean :: Configuration -> Logger -> IO ()

-- | Preview the site
preview :: Configuration -> Logger -> Rules a -> Int -> IO ()

-- | Rebuild the site
rebuild :: Configuration -> Logger -> Rules a -> IO ExitCode

-- | Start a server
server :: Configuration -> Logger -> String -> Int -> IO ()

-- | Upload the site
deploy :: Configuration -> IO ExitCode

-- | Watch and recompile for changes
watch :: Configuration -> Logger -> String -> Int -> Bool -> Rules a -> IO ()

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

-- | This usually 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 ()

-- | A variant of hakyll which expects a Configuration and
--   command-line Options. This gives freedom to implement your own
--   parsing.
hakyllWithArgs :: Configuration -> Options -> Rules a -> IO ()

-- | A variant of hakyll which returns an ExitCode
hakyllWithExitCode :: Configuration -> Rules a -> IO ExitCode
hakyllWithExitCodeAndArgs :: Configuration -> Options -> Rules a -> IO ExitCode

-- | The parsed command-line options.
data Options
Options :: Bool -> Command -> Options
[verbosity] :: Options -> Bool
[optCommand] :: Options -> Command

-- | The command to run.
data Command

-- | Generate the site.
Build :: Command

-- | Validate the site output.
Check :: Bool -> Command
[internal_links] :: Command -> Bool

-- | Clean up and remove cache.
Clean :: Command

-- | Upload/deploy your site.
Deploy :: Command

-- | 
--   
- DEPRECATED Please use the watch command.
--   

-- | Deprecated: Use Watch instead.
Preview :: Int -> Command
[port] :: Command -> Int

-- | Clean and build again.
Rebuild :: Command

-- | Start a preview server.
Server :: String -> Int -> Command
[host] :: Command -> String
[port] :: Command -> Int

-- | Autocompile on changes and start a preview server.
Watch :: String -> Int -> Bool -> Command
[host] :: Command -> String
[port] :: Command -> Int
[no_server] :: Command -> Bool
optionParser :: Configuration -> Parser Options
commandParser :: Configuration -> Parser Command
defaultParser :: Configuration -> IO Options
defaultParserPure :: Configuration -> [String] -> ParserResult Options
defaultParserPrefs :: ParserPrefs
defaultParserInfo :: Configuration -> ParserInfo Options
instance GHC.Show.Show Hakyll.Main.Options
instance GHC.Show.Show Hakyll.Main.Command

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