From d056680ca54b766b25635cf6afb7d305370209dd Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 12 Mar 2015 16:22:27 +0000 Subject: More -changes- dirty hacks for cabal sandboxing --- build/extract-title.hs | 2 +- build/tex-filter.hs | 2 +- default.html.do | 2 +- lists/default.md.do | 6 +++++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/build/extract-title.hs b/build/extract-title.hs index f3ca1ba..a84442e 100755 --- a/build/extract-title.hs +++ b/build/extract-title.hs @@ -5,7 +5,7 @@ import Text.Pandoc.JSON import System.IO extract_title :: Pandoc -> IO Pandoc -extract_title d@(Pandoc m _) = do hPutStrLn stderr $ render Nothing $ cat $ map pretty (docTitle m) +extract_title d@(Pandoc m _) = do hPutStrLn stderr $ (++) "title: " $ render Nothing $ cat $ map pretty (docTitle m) return d where pretty :: Inline -> Doc pretty (Str s) = text s diff --git a/build/tex-filter.hs b/build/tex-filter.hs index 5d11f07..1e2face 100755 --- a/build/tex-filter.hs +++ b/build/tex-filter.hs @@ -47,7 +47,7 @@ compileToSVG basepath t s = let tex = Data.Text.unpack $ Data.Text.strip $ Data. (do writeFile expr_path $ (display t) ++ tex writeFile align_path "0") alignment <- head.lines <$> readFile align_path - SIO.hPutStrLn SIO.stderr path + SIO.hPutStrLn SIO.stdout path return $ printf "%s" svg_web_path alignment tex texify :: [String] -> Inline -> IO Inline diff --git a/default.html.do b/default.html.do index b7e46ae..da9d0b2 100644 --- a/default.html.do +++ b/default.html.do @@ -1,7 +1,7 @@ redo-ifchange $2.md build/tex-filter.hs build/template.html5 texfilter() { - runhaskell -package-conf=$(find .cabal-sandbox -maxdepth 1 -iname '*.conf.d' | head -n 1) build/tex-filter.hs $@ + runhaskell -package-conf=$(find .cabal-sandbox -maxdepth 1 -iname '*.conf.d' | head -n 1) build/tex-filter.hs $@ 2>/dev/null } CSS=/style.css diff --git a/lists/default.md.do b/lists/default.md.do index fffd6e2..121955e 100644 --- a/lists/default.md.do +++ b/lists/default.md.do @@ -1,6 +1,10 @@ #!/usr/bin/env bash redo-ifchange "$2/title" +extracttitle() { + runhaskell -package-conf=$(find ../.cabal-sandbox -maxdepth 1 -iname '*.conf.d' | head -n 1) ../build/extract-title.hs $@ 2>&1 | grep 'title: ' | cut -d ' ' -f '2-' +} + POSTS=() while read -r -d $'\0'; do post=$(realpath --relative-to=. "$REPLY") @@ -20,7 +24,7 @@ EOF POST_TITLES=() for x in "${POSTS[@]}"; do - title=$(pandoc -t json "$x" | ../build/extract-title.hs 2>&1 >/dev/null) + title=$(pandoc -t json "$x" | extracttitle) POST_TITLES+=("$title") done -- cgit v1.2.3