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