tools: shake file requires pandoc, filters use current snapshot

This commit is contained in:
Simon Michael 2016-04-05 15:23:20 -07:00
parent 9439d1a611
commit 099870e96a
8 changed files with 15 additions and 13 deletions

View File

@ -1,5 +1,5 @@
#!/usr/bin/env stack #!/usr/bin/env stack
{- stack runghc {- stack runghc --verbosity info
--package base-prelude --package base-prelude
--package directory --package directory
--package extra --package extra
@ -7,6 +7,7 @@
--package safe --package safe
--package shake --package shake
--package time --package time
--package pandoc
-} -}
{- {-
Usage: see below. Usage: see below.
@ -49,6 +50,7 @@ usage = [i|Usage:
Commands: Commands:
compile compile
manpages manpages
webmanual
|] |]
manpages :: [String] manpages :: [String]
@ -72,10 +74,10 @@ buildDir :: FilePath
buildDir = ".build" buildDir = ".build"
pandocExe :: String pandocExe :: String
pandocExe = "pandoc" pandocExe = "stack exec -- pandoc" -- use the pandoc required above
pandocFiltersResolver :: String pandocFiltersResolver :: String
pandocFiltersResolver = "--resolver lts-5.11" pandocFiltersResolver = ""
main :: IO () main :: IO ()
main = do main = do
@ -133,7 +135,7 @@ main = do
md = manpageDir p </> p <.> "md" md = manpageDir p </> p <.> "md"
tmpl = "doc/manpage.html" tmpl = "doc/manpage.html"
need $ md : tmpl : pandocFilters need $ md : tmpl : pandocFilters
cmd "pandoc" md "--to markdown" cmd pandocExe md "--to markdown"
-- XXX assume this is compiled -- XXX assume this is compiled
"--filter tools/pandocRemoveManonlyBlocks" "--filter tools/pandocRemoveManonlyBlocks"
"-o" out "-o" out
@ -157,11 +159,11 @@ main = do
-- md = manpageDir p </> p <.> "md" -- md = manpageDir p </> p <.> "md"
-- tmpl = "doc/manpage.html" -- tmpl = "doc/manpage.html"
-- need [md, tmpl] -- need [md, tmpl]
-- cmd "pandoc" md "--to html --filter tools/pandocRemoveManpageBlocks.hs --template" tmpl "-o" out -- cmd pandocExe md "--to html --filter tools/pandocRemoveManpageBlocks.hs --template" tmpl "-o" out
-- "site/manual2.html" %> \out -> do -- "site/manual2.html" %> \out -> do
-- need ["site/manual2.md"] -- need ["site/manual2.md"]
-- cmd "pandoc site/manual2.md -o" out -- cmd pandocExe "site/manual2.md -o" out
-- "_build//*.o" %> \out -> do -- "_build//*.o" %> \out -> do
-- let c = dropDirectory1 $ out -<.> "c" -- let c = dropDirectory1 $ out -<.> "c"

View File

@ -1,5 +1,5 @@
#!/usr/bin/env stack #!/usr/bin/env stack
{- stack runghc --verbosity info --resolver lts-5.11 --package pandoc-types-1.16.1 -} {- stack runghc --verbosity info --package pandoc-types-1.16.1 -}
import Text.Pandoc.JSON import Text.Pandoc.JSON
import Text.Pandoc.Walk import Text.Pandoc.Walk

View File

@ -1,5 +1,5 @@
#!/usr/bin/env stack #!/usr/bin/env stack
{- stack runghc --verbosity info --resolver lts-5.11 --package pandoc-types-1.16.1 -} {- stack runghc --verbosity info --package pandoc-types-1.16.1 -}
import Text.Pandoc.JSON import Text.Pandoc.JSON

View File

@ -1,5 +1,5 @@
#!/usr/bin/env stack #!/usr/bin/env stack
{- stack runghc --verbosity info --resolver lts-5.11 --package pandoc-types-1.16.1 -} {- stack runghc --verbosity info --package pandoc-types-1.16.1 -}
import Text.Pandoc.JSON import Text.Pandoc.JSON

View File

@ -1,5 +1,5 @@
#!/usr/bin/env stack #!/usr/bin/env stack
{- stack runghc --verbosity info --resolver lts-5.11 --package pandoc-types-1.16.1 -} {- stack runghc --verbosity info --package pandoc-types-1.16.1 -}
import Text.Pandoc.JSON import Text.Pandoc.JSON

View File

@ -1,5 +1,5 @@
#!/usr/bin/env stack #!/usr/bin/env stack
{- stack runghc --verbosity info --resolver lts-5.11 --package pandoc-types-1.16.1 -} {- stack runghc --verbosity info --package pandoc-types-1.16.1 -}
import Text.Pandoc.Builder import Text.Pandoc.Builder
import Text.Pandoc.JSON import Text.Pandoc.JSON

View File

@ -1,5 +1,5 @@
#!/usr/bin/env stack #!/usr/bin/env stack
{- stack runghc --verbosity info --resolver lts-5.11 --package pandoc-types-1.16.1 -} {- stack runghc --verbosity info --package pandoc-types-1.16.1 -}
import Text.Pandoc.JSON import Text.Pandoc.JSON

View File

@ -1,5 +1,5 @@
#!/usr/bin/env stack #!/usr/bin/env stack
{- stack runghc --verbosity info --resolver lts-5.11 --package pandoc-types-1.16.1 -} {- stack runghc --verbosity info --package pandoc-types-1.16.1 -}
import Text.Pandoc.Builder import Text.Pandoc.Builder
import Text.Pandoc.JSON import Text.Pandoc.JSON