summaryrefslogtreecommitdiff
path: root/src/Hakyll/TeX/HaTeX.hs
blob: 790d57ccaf6ddbce29a3ebea7e4a2b369d080809 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
module Hakyll.TeX.HaTeX
    ( hatexCompiler
    , compileHatex
    ) where

import Prolog

import Hakyll
import Hakyll.Error
-- import Hakyll.Parsec.Parsec
import Text.LaTeX.Base
import Text.LaTeX.Base.Parser

compileHatex :: (StringConv s StrictText, Traversable t, MonadError [String] m) => t s -> m (t LaTeX)
compileHatex = traverse $ liftErr . parseLaTeX . toSL

hatexCompiler :: Compiler (Item LaTeX)
hatexCompiler = getResourceLBS >>= compileHatex