From 382982900ad3837b8a2ab7a8018fd10914be0ca9 Mon Sep 17 00:00:00 2001 From: Lucian Mogosanu Date: Thu, 25 Jul 2013 12:56:32 +0300 Subject: [PATCH] site: pandoc: compile math to mathml --- site.hs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/site.hs b/site.hs index 0f9a4b6..4510c2d 100644 --- a/site.hs +++ b/site.hs @@ -1,5 +1,6 @@ {-# LANGUAGE OverloadedStrings #-} import Data.Monoid (mappend) +import Text.Pandoc import Hakyll import Hakyll.Core.Configuration @@ -52,7 +53,7 @@ compilePosts :: Tags -> Rules () compilePosts tags = do route $ setExtension "html" let ctx = tagsCtx tags - compile $ pandocCompiler + compile $ tarpitCompiler >>= saveSnapshot "content" >>= loadAndApplyTemplate "templates/post.html" ctx >>= loadAndApplyTemplate "templates/default.html" ctx @@ -66,7 +67,7 @@ compileImages = do compilePages :: Rules () compilePages = do route $ setExtension "html" - compile $ pandocCompiler + compile $ tarpitCompiler >>= loadAndApplyTemplate "templates/default.html" defaultContext -- relative URLs break 404 pages, so don't do it here -- >>= relativizeUrls @@ -132,6 +133,18 @@ tarpitConfiguration = defaultConfiguration commStr = "rsync -avz -e 'ssh -p 2200' " ++ "_site/* mogosanu.ro:/virtual/sites/thetarpit.org" +-- pandoc reader and writer options +tarpitReaderOptions :: ReaderOptions +tarpitReaderOptions = defaultHakyllReaderOptions + +tarpitWriterOptions :: WriterOptions +tarpitWriterOptions = defaultHakyllWriterOptions + { writerHTMLMathMethod = MathML Nothing } + +-- tarpit compiler +tarpitCompiler :: Compiler (Item String) +tarpitCompiler = pandocCompilerWith tarpitReaderOptions tarpitWriterOptions + -- support for RSS feeds tarpitFeed :: FeedConfiguration tarpitFeed = FeedConfiguration -- 1.7.10.4