Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add meta to context for pre parse transformers

  • Loading branch information...
commit b2ffd528c3c2dc1828ba59dea4037e9c976d8807 1 parent 1758546
@sakari sakari authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 Network/Gitit/ContentTransformer.hs
View
9 Network/Gitit/ContentTransformer.hs
@@ -308,12 +308,17 @@ applyWikiTemplate c = do
-- | Converts Page to Pandoc, applies page transforms, and adds page
-- title.
pageToWikiPandoc :: Page -> ContentTransformer Pandoc
-pageToWikiPandoc page' =
+pageToWikiPandoc page' = do
+ addMetaToContext page'
pageToWikiPandoc' page' >>= addPageTitleToPandoc (pageTitle page')
pageToWikiPandoc' :: Page -> ContentTransformer Pandoc
pageToWikiPandoc' = applyPreParseTransforms >=>
- pageToPandoc >=> applyPageTransforms
+ pageToPandoc >=> applyPageTransforms
+
+-- | Add metadata to context
+addMetaToContext :: Page -> ContentTransformer ()
+addMetaToContext page = modifyContext $ \ctx -> ctx { ctxMeta = pageMeta page }
-- | Converts source text to Pandoc using default page type.
pageToPandoc :: Page -> ContentTransformer Pandoc
Please sign in to comment.
Something went wrong with that request. Please try again.