diff options
author | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2010-01-27 18:02:43 +0100 |
---|---|---|
committer | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2010-01-27 18:02:43 +0100 |
commit | 592845985828f3ee135c309257e9bbcb305be1fa (patch) | |
tree | 448833df96e0f708c1a8d4cc3ef62047b645d7e8 /src/Text/Hakyll/Internal | |
parent | f06b77bdef3f240249aa549064bd384c0cebed0a (diff) | |
download | hakyll-592845985828f3ee135c309257e9bbcb305be1fa.tar.gz |
Added createListing, createListingWith functions.
These functions were added to have a simpler and more high-level way to do the
common createCustomPage/renderAndConcat combination to create post lists, rss
feeds, ...
Diffstat (limited to 'src/Text/Hakyll/Internal')
-rw-r--r-- | src/Text/Hakyll/Internal/Template.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Text/Hakyll/Internal/Template.hs b/src/Text/Hakyll/Internal/Template.hs index 155189b..b6f73b7 100644 --- a/src/Text/Hakyll/Internal/Template.hs +++ b/src/Text/Hakyll/Internal/Template.hs @@ -29,7 +29,7 @@ data Template = Chunk String Template | End deriving (Show, Read, Eq) --- | Construct a "Template" from a string. +-- | Construct a @Template@ from a string. fromString :: String -> Template fromString [] = End fromString string @@ -41,7 +41,7 @@ fromString string where tail' = tail string --- | Read a "Template" from a file. This function might fetch the "Template" +-- | Read a @Template@ from a file. This function might fetch the @Template@ -- from the cache, if available. readTemplate :: FilePath -> Hakyll Template readTemplate path = do @@ -54,7 +54,7 @@ readTemplate path = do where fileName = "templates" </> path --- | Substitutes @$identifiers@ in the given "Template" by values from the given +-- | Substitutes @$identifiers@ in the given @Template@ by values from the given -- "Context". When a key is not found, it is left as it is. You can specify -- the characters used to replace escaped dollars (@$$@) here. substitute :: String -> Template -> Context -> String @@ -68,12 +68,12 @@ substitute escaper (EscapeCharacter template) context = escaper ++ substitute escaper template context substitute _ End _ = [] --- | "substitute" for use during a chain. This will leave escaped characters as +-- | @substitute@ for use during a chain. This will leave escaped characters as -- they are. regularSubstitute :: Template -> Context -> String regularSubstitute = substitute "$$" --- | "substitute" for the end of a chain (just before writing). This renders +-- | @substitute@ for the end of a chain (just before writing). This renders -- escaped characters. finalSubstitute :: Template -> Context -> String finalSubstitute = substitute "$" @@ -111,7 +111,7 @@ arbitraryTemplate length' = oneof [ do chunk <- chunk' return $ if null sanitized then "foo" else sanitized --- | Make "Template" testable. +-- | Make @Template@ testable. instance Arbitrary Template where arbitrary = choose (0, 20) >>= arbitraryTemplate |