summaryrefslogtreecommitdiff
path: root/src/Text/Hakyll/Internal
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2010-03-10 16:02:17 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2010-03-10 16:02:17 +0100
commit23f9d1e0cfb82260b73ce8799756fa6d3a838a70 (patch)
tree6dca9f11bfefafa5aeaeb27465236194abf3364d /src/Text/Hakyll/Internal
parentfa28eac8a395da7e524dc50d910d10dc1fa76a12 (diff)
downloadhakyll-23f9d1e0cfb82260b73ce8799756fa6d3a838a70.tar.gz
Removed xxxWith functions, they can be implemented more elegant using Arrows anyway.
Diffstat (limited to 'src/Text/Hakyll/Internal')
-rw-r--r--src/Text/Hakyll/Internal/Render.hs17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/Text/Hakyll/Internal/Render.hs b/src/Text/Hakyll/Internal/Render.hs
index 178e6ff..a771556 100644
--- a/src/Text/Hakyll/Internal/Render.hs
+++ b/src/Text/Hakyll/Internal/Render.hs
@@ -1,9 +1,6 @@
-- | Internal module do some low-level rendering.
module Text.Hakyll.Internal.Render
- ( substitute
- , regularSubstitute
- , finalSubstitute
- , pureRenderWith
+ ( pureRender
, writePage
) where
@@ -11,21 +8,19 @@ import qualified Data.Map as M
import Control.Monad.Reader (liftIO)
import Data.Maybe (fromMaybe)
-import Text.Hakyll.Context (Context, ContextManipulation)
import Text.Hakyll.File
import Text.Hakyll.Hakyll
import Text.Hakyll.HakyllAction
import Text.Hakyll.Internal.Template
-- | A pure render function.
-pureRenderWith :: ContextManipulation -- ^ Manipulation to apply on the context.
- -> Template -- ^ Template to use for rendering.
- -> Context -- ^ Renderable object to render with given template.
- -> Context -- ^ The body of the result will contain the render.
-pureRenderWith manipulation template context =
+pureRender :: Template -- ^ Template to use for rendering.
+ -> Context -- ^ Renderable object to render with given template.
+ -> Context -- ^ The body of the result will contain the render.
+pureRender template context =
-- Ignore $root when substituting here. We will only replace that in the
-- final render (just before writing).
- let contextIgnoringRoot = M.insert "root" "$root" (manipulation context)
+ let contextIgnoringRoot = M.insert "root" "$root" context
body = regularSubstitute template contextIgnoringRoot
in M.insert "body" body context