From 230688a0b842cf57b316a7ba62910ca387afbce7 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 3 Aug 2015 12:49:29 +0200 Subject: Start of complete rewrite to switch to hakyll --- build/extract-title.hs | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100755 build/extract-title.hs (limited to 'build/extract-title.hs') diff --git a/build/extract-title.hs b/build/extract-title.hs deleted file mode 100755 index 6964d26..0000000 --- a/build/extract-title.hs +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env runhaskell - --- import Text.Pandoc.Pretty --- import Text.Pandoc.JSON -import Text.Pandoc.Pretty -import Text.Pandoc.JSON -import qualified Text.Pandoc.Walk as W -import System.IO -import qualified Data.Aeson as A -import qualified Data.ByteString.Lazy as BL - -extract_title :: Pandoc -> String -extract_title (Pandoc m _) = do - title <- render Nothing $ cat $ map pretty (docTitle m) - return title - where pretty :: Inline -> Doc - pretty (Str s) = text s - pretty Space = space - pretty _ = empty - -main :: IO () -main = do - input <- BL.getContents - let title = (W.query extract_title :: Pandoc -> String) . either error id . A.eitherDecode' $ input - putStrLn title -- cgit v1.2.3