shakebook-0.2.2.0: Shake-based technical documentation generator; HTML & PDF

Safe HaskellNone
LanguageHaskell2010

Shakebook.Data

Synopsis

Documentation

class HasLocalOut r where Source #

Instances
HasLocalOut ShakebookEnv Source # 
Instance details

Defined in Shakebook.Data

class HasLocalSrc r where Source #

newtype PathDisplay a t Source #

Constructors

PathDisplay (Path a t) 
Instances
Display (PathDisplay a t) Source # 
Instance details

Defined in Shakebook.Data

newtype WithinDisplay a t Source #

Constructors

WithinDisplay (Within a t) 
Instances
Display [WithinDisplay a t] Source # 
Instance details

Defined in Shakebook.Data

Display (WithinDisplay a t) Source # 
Instance details

Defined in Shakebook.Data

data SbConfig Source #

Instances
Show SbConfig Source # 
Instance details

Defined in Shakebook.Data

class HasSbConfig a where Source #

Instances
HasSbConfig ShakebookEnv Source # 
Instance details

Defined in Shakebook.Data

viewSrcPath :: Value -> Text Source #

View the "srcPath" field of a JSON Value.

withSrcPath :: Text -> Value -> Value Source #

Add "srcPath" field based on input Text.

withBaseUrl :: Text -> Value -> Value Source #

Add "baseUrl" field from input Text.

withFullUrl :: Text -> Value -> Value Source #

Add "fullUrl" field from input Text.

viewUrl :: Value -> Text Source #

View the "url" field of a JSON Value.

withUrl :: Text -> Value -> Value Source #

Add "url" field from input Text.

enrichFullUrl :: Text -> Value -> Value Source #

Assuming a "url" field, enrich via a baseURL

enrichUrl :: (Text -> Text) -> Value -> Value Source #

Assuming a srcPath field, enrich using withUrl using a Text -> Text transformation.

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.

paginate' :: MonadThrow m => Int -> [a] -> m (Zipper [] [a]) Source #

loadSortFilterEnrich Source #

Arguments

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

loadSortEnrich Source #

Arguments

:: (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.