diff options
| author | Viktor Kleen <viktor@kleen.org> | 2015-01-02 09:29:04 +0000 | 
|---|---|---|
| committer | Viktor Kleen <viktor@kleen.org> | 2015-01-02 09:29:04 +0000 | 
| commit | f7d4ba2023ab18b9d7c5fad85cbb863c61e6272c (patch) | |
| tree | 7ffe93f3629546f8a0cb4ca7c7c7ce70196e4387 /build/add-math-kleen-org.hs | |
| download | dirty-haskell.org-f7d4ba2023ab18b9d7c5fad85cbb863c61e6272c.tar dirty-haskell.org-f7d4ba2023ab18b9d7c5fad85cbb863c61e6272c.tar.gz dirty-haskell.org-f7d4ba2023ab18b9d7c5fad85cbb863c61e6272c.tar.bz2 dirty-haskell.org-f7d4ba2023ab18b9d7c5fad85cbb863c61e6272c.tar.xz dirty-haskell.org-f7d4ba2023ab18b9d7c5fad85cbb863c61e6272c.zip | |
initial commit
Diffstat (limited to 'build/add-math-kleen-org.hs')
| -rwxr-xr-x | build/add-math-kleen-org.hs | 13 | 
1 files changed, 13 insertions, 0 deletions
| diff --git a/build/add-math-kleen-org.hs b/build/add-math-kleen-org.hs new file mode 100755 index 0000000..e564149 --- /dev/null +++ b/build/add-math-kleen-org.hs | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | #!/usr/bin/env runhaskell | ||
| 2 | |||
| 3 | import Data.Map | ||
| 4 | import Text.Pandoc.Pretty | ||
| 5 | import Text.Pandoc.JSON | ||
| 6 | import System.IO | ||
| 7 | |||
| 8 | add_title :: Pandoc -> Pandoc | ||
| 9 | add_title (Pandoc m bs) = Pandoc (add_title' m) bs | ||
| 10 | where add_title' m@(Meta map) = Meta $ insert "title" (MetaInlines $ [Link [Str "math.kleen.org:"] ("/","math.kleen.org"), Space] ++ docTitle m) map | ||
| 11 | |||
| 12 | main :: IO () | ||
| 13 | main = toJSONFilter add_title | ||
