forked from write-you-a-scheme-v2/scheme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Build.hs
25 lines (20 loc) · 770 Bytes
/
Build.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
module Main where
import Prelude hiding ((*>))
import Development.Shake
import Development.Shake.FilePath
main :: IO ()
main = shakeArgs shakeOptions $ do
want ["output/scheme.html"]
want ["wiki"]
phony "wiki" $ do
files <- fmap ("docs/" </>) <$> getDirectoryFiles "docs" ["*.md"]
let targets = ["output" </> (f -<.> "wiki") | f <- files]
need targets
"output/scheme.html" *> \out -> do
need ["resources/page.tmpl"]
files <- fmap ("docs/" </>) <$> getDirectoryFiles "docs" ["*.md"]
need files
cmd "pandoc" files ["-o"] out ["--template", "resources/page.tmpl"]
"output//*.wiki" %> \out -> do
let src = dropDirectory1 $ out -<.> "md"
cmd "pandoc" src "-o" out ["-t", "mediawiki"]