From: Lucian Mogosanu Date: Thu, 25 Jul 2013 09:56:32 +0000 (+0300) Subject: site: pandoc: compile math to mathml X-Git-Tag: v0.1~2^2~3 X-Git-Url: https://git.mogosanu.ro/?a=commitdiff_plain;h=382982900ad3837b8a2ab7a8018fd10914be0ca9;p=thetarpit.git site: pandoc: compile math to mathml --- 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