Module containing various functions to manipulate contexts.
- type Context = Map String String
- type ContextManipulation = Context -> Context
- renderValue :: String -> String -> (String -> String) -> ContextManipulation
- renderDate :: String -> String -> String -> ContextManipulation
Documentation
type ContextManipulation = Context -> ContextSource
Type for context manipulating functions.
:: String | Key of which the value should be copied. |
-> String | Key the value should be copied to. |
-> (String -> String) | Function to apply on the value. |
-> ContextManipulation |
Do something with a value of a context.
:: String | Key in which the rendered date should be placed. |
-> String | Format to use on the date. |
-> String | Default value when the date cannot be parsed. |
-> ContextManipulation |
When the context has a key called path
in a `yyyy-mm-dd-title.extension`
format (default for pages), this function can render the date.