building using stack
This commit is contained in:
parent
9297024b5f
commit
8b23b1d5ab
3 changed files with 12 additions and 4 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -1,6 +1,7 @@
|
||||||
TAGS
|
TAGS
|
||||||
|
build/
|
||||||
compile
|
compile
|
||||||
compile.hi
|
*.hi
|
||||||
compile.o
|
*.o
|
||||||
*.html
|
*.html
|
||||||
*.pdf
|
*.pdf
|
||||||
|
|
7
build.sh
Executable file
7
build.sh
Executable 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
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue