-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A quick & easy static site builder built with shake and pandoc. -- -- Please see the README on GitHub at -- https://github.com/ChrisPenner/slick#readme @package slick @version 1.1.2.2 -- | Deprecated: No longer necessary with slick >= 0.3.0.0 module Slick.Caching -- | Note that you probably don't need this if you're using the recommended -- Development.Shake.Forward module. It can do a lot of caching -- for you, otherwise look at cacheAction. -- -- A wrapper around jsonCache which simplifies caching of values -- which do NOT depend on an input parameter. Unfortunately Shake still -- requires that the key type implement several typeclasses, however this -- is easily accomplished using GeneralizedNewtypeDeriving and a -- wrapper around (). example usage: -- --
--   {-# LANGUAGE GeneralizedNewtypeDeriving #-}
--   module Main where
--   newtype ProjectList = ProjectList ()
--     deriving (Show, Eq, Hashable, Binary, NFData)
--   
-- -- Within your shake Rules: -- --
--   projectCache = simpleJsonCache (ProjectList ()) $ do
--     -- load your project list here; returning it as a Value
--   
simpleJsonCache :: ShakeValue q => q -> Action Value -> Rules (Action Value) -- | Like simpleJsonCache but allows caching any JSON serializable -- object. simpleJsonCache' :: forall q a. (ToJSON a, FromJSON a, ShakeValue q) => q -> Action a -> Rules (Action a) -- | Note that you probably don't need this if you're using the recommended -- Development.Shake.Forward module. It can do a lot of caching -- for you, otherwise look at cacheAction. -- -- A wrapper around addOracleCache which given a q which -- is a ShakeValue allows caching and retrieving Values -- within Shake. See documentation on addOracleCache or see Slick -- examples for more info. -- --
--   -- We need to define a unique datatype as our cache key
--   newtype PostFilePath =
--     PostFilePath String
--   -- We can derive the classes we need (using GeneralizedNewtypeDeriving)
--   -- so long as the underlying type implements them
--     deriving (Show, Eq, Hashable, Binary, NFData)
--   -- now in our shake rules we can create a cache by providing a loader action
--   
--   do
--   postCache <- jsonCache $ \(PostFilePath path) ->
--     readFile' path >>= markdownToHTML . Text.pack
--   -- Now use postCache inside an Action to load your post with caching!
--   
jsonCache :: ShakeValue q => (q -> Action Value) -> Rules (q -> Action Value) -- | Like jsonCache but allows caching/retrieving any JSON -- serializable objects. jsonCache' :: forall a q. (ToJSON a, FromJSON a, ShakeValue q) => (q -> Action a) -> Rules (q -> Action a) instance Data.Hashable.Class.Hashable q => Data.Hashable.Class.Hashable (Slick.Caching.CacheQuery q) instance Control.DeepSeq.NFData q => Control.DeepSeq.NFData (Slick.Caching.CacheQuery q) instance Data.Binary.Class.Binary q => Data.Binary.Class.Binary (Slick.Caching.CacheQuery q) instance GHC.Generics.Generic (Slick.Caching.CacheQuery q) instance GHC.Classes.Eq q => GHC.Classes.Eq (Slick.Caching.CacheQuery q) instance GHC.Show.Show q => GHC.Show.Show (Slick.Caching.CacheQuery q) module Slick.Mustache -- | Like compileTemplate from mustache but tracks changes to -- template files and partials within Shake for cache-busting. compileTemplate' :: FilePath -> Action Template module Slick.Shake -- | Build your slick site. This is a good candidate for your main -- function. -- -- Calls through to shakeArgsForward with extra verbosity slick :: Action () -> IO () -- | Build your slick site with the provided shake options. This is a good -- candidate for your main function. -- -- | Calls through to shakeArgsForward with the provided options slickWithOpts :: ShakeOptions -> Action () -> IO () module Slick.Utils -- | Given a list of extensions and directories, find all files that match, -- and return full paths. getDirectoryPaths :: [FilePath] -> [FilePath] -> Action [FilePath] -- | Attempt to convert between two JSON serializable objects (or -- Values). Failure to deserialize fails the Shake build. convert :: (FromJSON a, ToJSON a, FromJSON b) => a -> Action b module Slick.Pandoc -- | Convert markdown text into a Value; -- -- The Value has a "content" key containing rendered HTML. -- -- Metadata is assigned on the respective keys in the Value markdownToHTML :: Text -> Action Value -- | Like markdownToHTML but allows returning any JSON serializable -- object markdownToHTML' :: FromJSON a => Text -> Action a -- | Like markdownToHTML but allows providing additional pandoc -- reader and writer options markdownToHTMLWithOpts :: ReaderOptions -> WriterOptions -> Text -> Action Value -- | Like markdownToHTMLWithOpts but returns any JSON serializable -- object. markdownToHTMLWithOpts' :: FromJSON a => ReaderOptions -> WriterOptions -> Text -> Action a -- | Convert org-mode text into a Value; -- -- The Value has a "content" key containing rendered HTML. -- -- Metadata is assigned on the respective keys in the Value orgModeToHTML :: Text -> Action Value -- | Like orgModeToHTML but allows returning any JSON compatible -- object. orgModeToHTML' :: FromJSON a => Text -> Action a -- | Like orgModeToHTML but allows providing additional pandoc -- reader and writer options orgModeToHTMLWithOpts :: ReaderOptions -> WriterOptions -> Text -> Action Value -- | Like orgModeToHTMLWithOpts but allows returning any JSON -- compatible object orgModeToHTMLWithOpts' :: FromJSON a => ReaderOptions -> WriterOptions -> Text -> Action a -- | Given a reader from Readers this creates a loader which given -- the source document will read its metadata into a Value -- returning both the Pandoc object and the metadata within an -- Action. The metadata values will be read as Markdown but -- rendered as plain text, removing any links, pictures, and inline -- formatting. makePandocReader :: PandocReader textType -> textType -> Action (Pandoc, Value) -- | Like makePandocReader but will deserialize the metadata into -- any object which implements FromJSON. Failure to deserialize -- will fail the Shake build. Metadata values will be read as Markdown -- but rendered as plain text, removing any links, pictures, and inline -- formatting. makePandocReader' :: FromJSON a => PandocReader textType -> textType -> Action (Pandoc, a) -- | Given a reader from Readers, and a writer from Writers, -- this creates a loader which given the source document will read its -- metadata as Markdown, then render it into a Value using the -- writer, returning both the Pandoc object and the metadata -- within an Action makePandocReaderWithMetaWriter :: PandocReader textType -> PandocWriter -> textType -> Action (Pandoc, Value) -- | Like makePandocReaderWithMetaWriter but will deserialize the -- metadata into any object which implements FromJSON. Failure to -- deserialize will fail the Shake build. makePandocReaderWithMetaWriter' :: FromJSON a => PandocReader textType -> PandocWriter -> textType -> Action (Pandoc, a) type PandocReader textType = textType -> PandocIO Pandoc type PandocWriter = Pandoc -> PandocIO Text -- | Load in a source document using the given PandocReader, then -- render the Pandoc into text using the given -- PandocWriter. Returns a Value wherein the rendered text -- is set to the "content" key and any metadata is set to its respective -- key in the Value loadUsing :: PandocReader textType -> PandocWriter -> textType -> Action Value -- | Like loadUsing but allows also deserializes the Value -- into any object which implements FromJSON. Failure to -- deserialize will fail the Shake build. loadUsing' :: FromJSON a => PandocReader textType -> PandocWriter -> textType -> Action a -- | Load in a source document using the given PandocReader, then -- render the Pandoc into text using the given -- PandocWriter. Takes a second PandocWriter to render -- metadata. Returns a Value wherein the rendered text is set to -- the "content" key and any metadata is set to its respective key in the -- Value loadUsingMeta :: PandocReader textType -> PandocWriter -> PandocWriter -> textType -> Action Value -- | Reasonable options for reading a markdown file. Behaves similar to -- Github Flavoured Markdown defaultMarkdownOptions :: ReaderOptions -- | Reasonable options for reading an org-mode file defaultOrgModeOptions :: ReaderOptions -- | Reasonable options for rendering to HTML. Includes default code -- highlighting rules defaultHtml5Options :: WriterOptions -- | Attempt to convert between two JSON serializable objects (or -- Values). Failure to deserialize fails the Shake build. convert :: (FromJSON a, ToJSON a, FromJSON b) => a -> Action b -- | Flatten a Pandoc Meta into a well-structured JSON object, -- rendering Pandoc text objects into plain strings along the way. flattenMeta :: PandocWriter -> Meta -> Action Value module Slick -- | Build your slick site. This is a good candidate for your main -- function. -- -- Calls through to shakeArgsForward with extra verbosity slick :: Action () -> IO () -- | Build your slick site with the provided shake options. This is a good -- candidate for your main function. -- -- | Calls through to shakeArgsForward with the provided options slickWithOpts :: ShakeOptions -> Action () -> IO () -- | Convert markdown text into a Value; -- -- The Value has a "content" key containing rendered HTML. -- -- Metadata is assigned on the respective keys in the Value markdownToHTML :: Text -> Action Value -- | Like markdownToHTML but allows returning any JSON serializable -- object markdownToHTML' :: FromJSON a => Text -> Action a -- | Convert org-mode text into a Value; -- -- The Value has a "content" key containing rendered HTML. -- -- Metadata is assigned on the respective keys in the Value orgModeToHTML :: Text -> Action Value -- | Like orgModeToHTML but allows returning any JSON compatible -- object. orgModeToHTML' :: FromJSON a => Text -> Action a -- | Like compileTemplate from mustache but tracks changes to -- template files and partials within Shake for cache-busting. compileTemplate' :: FilePath -> Action Template -- | Substitutes all mustache defined tokens (or tags) for values found in -- the provided data structure. -- -- Equivalent to substituteValue . toMustache. substitute :: ToMustache k => Template -> k -> Text -- | Given a list of extensions and directories, find all files that match, -- and return full paths. getDirectoryPaths :: [FilePath] -> [FilePath] -> Action [FilePath] -- | Attempt to convert between two JSON serializable objects (or -- Values). Failure to deserialize fails the Shake build. convert :: (FromJSON a, ToJSON a, FromJSON b) => a -> Action b