summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbuild/extract-title.hs2
-rwxr-xr-xbuild/tex-filter.hs2
-rw-r--r--default.html.do2
-rw-r--r--lists/default.md.do6
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
5import System.IO 5import System.IO
6 6
7extract_title :: Pandoc -> IO Pandoc 7extract_title :: Pandoc -> IO Pandoc
8extract_title d@(Pandoc m _) = do hPutStrLn stderr $ render Nothing $ cat $ map pretty (docTitle m) 8extract_title d@(Pandoc m _) = do hPutStrLn stderr $ (++) "title: " $ render Nothing $ cat $ map pretty (docTitle m)
9 return d 9 return d
10 where pretty :: Inline -> Doc 10 where pretty :: Inline -> Doc
11 pretty (Str s) = text s 11 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.
47 (do writeFile expr_path $ (display t) ++ tex 47 (do writeFile expr_path $ (display t) ++ tex
48 writeFile align_path "0") 48 writeFile align_path "0")
49 alignment <- head.lines <$> readFile align_path 49 alignment <- head.lines <$> readFile align_path
50 SIO.hPutStrLn SIO.stderr path 50 SIO.hPutStrLn SIO.stdout path
51 return $ printf "<object data=\"/%s\" type=\"image/svg+xml\" style=\"vertical-align:-%s\">%s</object>" svg_web_path alignment tex 51 return $ printf "<object data=\"/%s\" type=\"image/svg+xml\" style=\"vertical-align:-%s\">%s</object>" svg_web_path alignment tex
52 52
53texify :: [String] -> Inline -> IO Inline 53texify :: [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 @@
1redo-ifchange $2.md build/tex-filter.hs build/template.html5 1redo-ifchange $2.md build/tex-filter.hs build/template.html5
2 2
3texfilter() { 3texfilter() {
4 runhaskell -package-conf=$(find .cabal-sandbox -maxdepth 1 -iname '*.conf.d' | head -n 1) build/tex-filter.hs $@ 4 runhaskell -package-conf=$(find .cabal-sandbox -maxdepth 1 -iname '*.conf.d' | head -n 1) build/tex-filter.hs $@ 2>/dev/null
5} 5}
6 6
7CSS=/style.css 7CSS=/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 @@
1#!/usr/bin/env bash 1#!/usr/bin/env bash
2redo-ifchange "$2/title" 2redo-ifchange "$2/title"
3 3
4extracttitle() {
5 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-'
6}
7
4POSTS=() 8POSTS=()
5while read -r -d $'\0'; do 9while read -r -d $'\0'; do
6 post=$(realpath --relative-to=. "$REPLY") 10 post=$(realpath --relative-to=. "$REPLY")
@@ -20,7 +24,7 @@ EOF
20 24
21POST_TITLES=() 25POST_TITLES=()
22for x in "${POSTS[@]}"; do 26for x in "${POSTS[@]}"; do
23 title=$(pandoc -t json "$x" | ../build/extract-title.hs 2>&1 >/dev/null) 27 title=$(pandoc -t json "$x" | extracttitle)
24 POST_TITLES+=("$title") 28 POST_TITLES+=("$title")
25done 29done
26 30