building using stack

This commit is contained in:
Yann Esposito 2016-03-30 09:52:51 +02:00
parent 9297024b5f
commit 8b23b1d5ab
3 changed files with 12 additions and 4 deletions

5
.gitignore vendored
View file

@ -1,6 +1,7 @@
TAGS
build/
compile
compile.hi
compile.o
*.hi
*.o
*.html
*.pdf

7
build.sh Executable file
View file

@ -0,0 +1,7 @@
#!/usr/bin/env zsh
if hash stack 2>/dev/null; then
stack ghc -- -odir build -hidir build compile.hs -O2
else
print -- "Please install 'stack' (http://haskellstack.org)"
fi

View file

@ -60,7 +60,7 @@ main = do
-- | Find Markdown Files (skip hidden directories)
findMarkdownFiles :: Shell FilePath
findMarkdownFiles = do
fic <- find (has ".md") "." & fgrep (invert (prefix "./."))
fic <- find (suffix ".md") "." & fgrep (invert (prefix "./."))
let mf = stripPrefix "./" fic
_ <- guard (isJust mf)
return (fromJust mf)
@ -101,7 +101,7 @@ toReveal dbg fpath = do
mslideLevel <- fold (fpath & filename
& input
& grep (prefix "slide_level: ")
& sed (prefix "slide_level: " *> star digit))
& sed (prefix ("slide_level: " *> plus digit)))
Fold.head
let slideLevel = maybe "2" (\l -> if l == "" then "2" else l) mslideLevel
dest = fpath & filename