From 592845985828f3ee135c309257e9bbcb305be1fa Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Wed, 27 Jan 2010 18:02:43 +0100 Subject: 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, ... --- src/Text/Hakyll/Internal/Template.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/Text/Hakyll/Internal/Template.hs') 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 -- cgit v1.2.3