summaryrefslogtreecommitdiff
path: root/src/Hakyll/TeX/LaTeX.hs
blob: 8f6d5ccf22aaaad63e1164c433572f0ca63b2e96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
module Hakyll.TeX.LaTeX
    ( latexPdfCompiler
    , compileLatexPdf
    , rubberPipe
    ) where

import Prolog

import Hakyll

rubberPipe :: [String] -> LazyByteString -> Compiler LazyByteString
rubberPipe = unixFilterLBS "rubber-pipe"

compileLatexPdf :: (StringConv s LazyByteString, Traversable t) => t s -> Compiler (t LazyByteString)
compileLatexPdf = traverse $ rubberPipe [ "--pdf" ] . toSL

latexPdfCompiler :: Compiler (Item LazyByteString)
latexPdfCompiler = getResourceLBS >>= compileLatexPdf