summaryrefslogtreecommitdiff
path: root/build/add-math-kleen-org.hs
blob: e564149ddfd686bcbae1301f061f9a53b45b16df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/env runhaskell

import Data.Map
import Text.Pandoc.Pretty
import Text.Pandoc.JSON
import System.IO

add_title :: Pandoc -> Pandoc
add_title (Pandoc m bs) = Pandoc (add_title' m) bs
  where add_title' m@(Meta map) = Meta $ insert "title" (MetaInlines $ [Link [Str "math.kleen.org:"] ("/","math.kleen.org"), Space] ++ docTitle m) map

main :: IO ()
main = toJSONFilter add_title