Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Configuration = Configuration {
- beginItemTag :: Int -> String
- endItemTag :: Int -> String
- beginCollectionTag :: Int -> String
- endCollectionTag :: Int -> String
- defaultConfiguration :: Configuration
- metadataConfiguration :: Metadata -> Configuration -> Configuration
- dirListField :: Configuration -> String -> Context a -> Compiler [Item a] -> Context b
Documentation
data Configuration Source #
Configuration for allowing variation of collection and item tags in dependency of the hierarchical directory level. The level count begins with zero.
Configuration | |
|
defaultConfiguration :: Configuration Source #
Default configuration for dirListField
metadataConfiguration :: Metadata -> Configuration -> Configuration Source #
Read Configuration from Metadata the given default Configuration is used if no coresponding metadata field is found. The fields are: beginItemTag, endItemTag, beginCollectionTag, endCollectionTag These fields can hold a list of tags which are separated by the value of the field tagDelimiter, or if not given an ','. The list holds the tags per level, if level is higher than the tags in the list the last tag is used.
dirListField :: Configuration -> String -> Context a -> Compiler [Item a] -> Context b Source #
The exported dirListField
function is similar to the
listField
template function but creates
additional context information which can be used in the template
to create a hierarchical menu.
Context usable inside the template
$begin-tags$
- injects
<li>
and<ul>
tags if apropriate
$end-tags$
- contains the corresponding
</li>
and</ul>
tags $full-page-id$
- is the hyphen seperated path of the page
Metainformation in the source files
For each subdirectory which should be processed one source file with the same base name should exist which can contain meta information:
pages/a.md
- top page for directory a
pages/a/foo.md
- page foo within a
The following meta information can be given
page-id
- part of the generated id, if not given the base name of the file
page-order
- give an ordering key for sorting in the current
directory level, if not given the
page-id
will be used