|
|
|
Description |
Module containing various functions to manipulate contexts.
|
|
Synopsis |
|
|
|
Documentation |
|
|
Type for a context.
|
|
|
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 in a Context, but keep the old value as well.
This is probably the most common function to construct a
ContextManipulation.
|
|
|
|
:: String | Key of which the value should be changed.
| -> String -> String | Function to apply on the value.
| -> ContextManipulation | | Change a value in a Context.
import Data.Char (toUpper)
changeValue "title" (map toUpper)
Will put the title in UPPERCASE.
|
|
|
|
:: 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.
renderDate "date" "%B %e, %Y" "Date unknown"
Will render something like January 32, 2010.
|
|
|
|
:: String | Extension to change to.
| -> ContextManipulation | | Change the extension of a file. This is only needed when you want to
render, for example, mardown to .php files instead of .html files.
renderChainWith (changeExtension "php")
["templates/default.html"]
(createPagePath "test.markdown")
Will render to test.php instead of test.html.
|
|
|
Produced by Haddock version 2.6.0 |