@@ -87,11 +87,16 @@ field' key value = Context $ \k i -> if k == key then value i else empty
8787
8888
8989--------------------------------------------------------------------------------
90−field :: String -> (Item a -> Compiler String) -> Context a
90+-- | Constructs a new field in the 'Context.'
91+field :: String -- ^ Key
92+ -> (Item a -> Compiler String) -- ^ Function that constructs a
93+ -- value based on the item
94+ -> Context a
9195field key value = field' key (fmap StringField . value)
9296
9397
9498--------------------------------------------------------------------------------
99+-- | Creates a 'field' that does not depend on the 'Item'
95100constField :: String -> String -> Context a
96101constField key = field key . const . return
97102
@@ -149,6 +154,7 @@ teaserSeparator = "<!--more-->"
149154
150155
151156--------------------------------------------------------------------------------
157+-- | Constructs a 'field' that contains the body of the item.
152158bodyField :: String -> Context String
153159bodyField key = field key $ return . itemBody
154160
@@ -175,7 +181,7 @@ pathField key = field key $ return . toFilePath . itemIdentifier
175181
176182
177183--------------------------------------------------------------------------------
178−-- | This title field takes the basename of the underlying file by default
184+-- | This title 'field' takes the basename of the underlying file by default
179185titleField :: String -> Context a
180186titleField = mapContext takeBaseName . pathField
181187