Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- needLocalOut :: (MonadAction m, MonadReader r m, HasLocalOut r) => [Path Rel File] -> m ()
- (%->) :: (MonadReader r m, MonadRules m, HasLocalOut r) => FilePattern -> (Within Rel File -> RAction r ()) -> m ()
- class HasLocalOut r where
- class HasLocalSrc r where
- newtype PathDisplay a t = PathDisplay (Path a t)
- newtype WithinDisplay a t = WithinDisplay (Within a t)
- type ToC = Cofree [] String
- data SbConfig = SbConfig {}
- class HasSbConfig a where
- data ShakebookEnv = ShakebookEnv {}
- viewSrcPath :: Value -> Text
- withSrcPath :: Text -> Value -> Value
- withBaseUrl :: Text -> Value -> Value
- withFullUrl :: Text -> Value -> Value
- viewUrl :: Value -> Text
- withUrl :: Text -> Value -> Value
- enrichFullUrl :: Text -> Value -> Value
- enrichUrl :: (Text -> Text) -> Value -> Value
- leadingSlash :: Path Abs Dir
- withHtmlExtension :: MonadThrow m => Path Rel File -> m (Path Rel File)
- withMarkdownExtension :: MonadThrow m => Path Rel File -> m (Path Rel File)
- generateSupposedUrl :: MonadThrow m => Path Rel File -> m (Path Abs File)
- enrichSupposedUrl :: (MonadReader r m, HasSbConfig r, MonadThrow m) => Value -> m Value
- readMarkdownFile' :: (MonadReader r m, HasSbConfig r, MonadAction m) => Within Rel File -> m Value
- data PaginationException = EmptyContentsError
- paginate' :: MonadThrow m => Int -> [a] -> m (Zipper [] [a])
- lower :: Cofree [] Value -> [Value]
- type MonadShakebook r m = (MonadReader r m, HasSbConfig r, HasLogFunc r, MonadIO m, MonadThrow m, HasLocalOut r)
- type MonadShakebookAction r m = (MonadShakebook r m, MonadAction m)
- type MonadShakebookRules r m = (MonadShakebook r m, MonadRules m)
- loadSortFilterEnrich :: (MonadShakebookAction r m, Ord b) => [FilePattern] -> (Value -> b) -> (Value -> Bool) -> (Value -> Value) -> m [(Within Rel File, Value)]
- loadSortEnrich :: (MonadShakebookAction r m, Ord b) => [FilePattern] -> (Value -> b) -> (Value -> Value) -> m [(Within Rel File, Value)]
Documentation
needLocalOut :: (MonadAction m, MonadReader r m, HasLocalOut r) => [Path Rel File] -> m () Source #
(%->) :: (MonadReader r m, MonadRules m, HasLocalOut r) => FilePattern -> (Within Rel File -> RAction r ()) -> m () Source #
class HasLocalOut r where Source #
Instances
HasLocalOut ShakebookEnv Source # | |
Defined in Shakebook.Data |
newtype PathDisplay a t Source #
PathDisplay (Path a t) |
Instances
Display (PathDisplay a t) Source # | |
Defined in Shakebook.Data display :: PathDisplay a t -> Utf8Builder # textDisplay :: PathDisplay a t -> Text # |
newtype WithinDisplay a t Source #
WithinDisplay (Within a t) |
Instances
Display [WithinDisplay a t] Source # | |
Defined in Shakebook.Data display :: [WithinDisplay a t] -> Utf8Builder # textDisplay :: [WithinDisplay a t] -> Text # | |
Display (WithinDisplay a t) Source # | |
Defined in Shakebook.Data display :: WithinDisplay a t -> Utf8Builder # textDisplay :: WithinDisplay a t -> Text # |
class HasSbConfig a where Source #
Instances
HasSbConfig ShakebookEnv Source # | |
Defined in Shakebook.Data |
data ShakebookEnv Source #
Instances
HasLogFunc ShakebookEnv Source # | |
Defined in Shakebook.Data | |
HasSbConfig ShakebookEnv Source # | |
Defined in Shakebook.Data | |
HasLocalOut ShakebookEnv Source # | |
Defined in Shakebook.Data |
viewSrcPath :: Value -> Text Source #
View the "srcPath" field of a JSON Value.
enrichUrl :: (Text -> Text) -> Value -> Value Source #
Assuming a srcPath
field, enrich using withUrl using a Text -> Text transformation.
withHtmlExtension :: MonadThrow m => Path Rel File -> m (Path Rel File) Source #
withMarkdownExtension :: MonadThrow m => Path Rel File -> m (Path Rel File) Source #
generateSupposedUrl :: MonadThrow m => Path Rel File -> m (Path Abs File) Source #
enrichSupposedUrl :: (MonadReader r m, HasSbConfig r, MonadThrow m) => Value -> m Value Source #
readMarkdownFile' :: (MonadReader r m, HasSbConfig r, MonadAction m) => Within Rel File -> m Value Source #
Get a JSON Value of Markdown Data with markdown body as "contents" field and the srcPath as "srcPath" field.
data PaginationException Source #
Instances
Eq PaginationException Source # | |
Defined in Shakebook.Data (==) :: PaginationException -> PaginationException -> Bool # (/=) :: PaginationException -> PaginationException -> Bool # | |
Show PaginationException Source # | |
Defined in Shakebook.Data showsPrec :: Int -> PaginationException -> ShowS # show :: PaginationException -> String # showList :: [PaginationException] -> ShowS # | |
Exception PaginationException Source # | |
Defined in Shakebook.Data |
type MonadShakebook r m = (MonadReader r m, HasSbConfig r, HasLogFunc r, MonadIO m, MonadThrow m, HasLocalOut r) Source #
type MonadShakebookAction r m = (MonadShakebook r m, MonadAction m) Source #
type MonadShakebookRules r m = (MonadShakebook r m, MonadRules m) Source #
:: (MonadShakebookAction r m, Ord b) | |
=> [FilePattern] | A shake filepattern to load, relative to srcDir from SbConfig. |
-> (Value -> b) | A value to sortOn e.g (Down . viewPostTime) |
-> (Value -> Bool) | A filtering predicate e.g (elem tag . viewTags) |
-> (Value -> Value) | An initial enrichment. This is pure so can only be data derived from the initial markdown. |
-> m [(Within Rel File, Value)] | A list of Values indexed by their srcPath. |
Multi-markdown loader. Allows you to load a filepattern of markdown as a list of JSON values ready to pass to an HTML template. You will probably want to add additional data before you write. See the examples in Shakebook.Defaults
:: (MonadShakebookAction r m, Ord b) | |
=> [FilePattern] | A Shake filepattern to load. |
-> (Value -> b) | A value to sortOn e.g (Down . viewPostTime). |
-> (Value -> Value) | An initial pure enrichment. |
-> m [(Within Rel File, Value)] | A list of Values index by their srcPath. |
The same as loadSortFilterEnrich
but without filtering.