tools: use latest pandoc, avoiding SoftBreak error
Require a recent snapshot with the latest pandoc-types for the pandoc filters (may be different from the snapshot used to build hledger).
This commit is contained in:
parent
01c0f40d00
commit
df3cb6d334
11
Shake.hs
11
Shake.hs
@ -71,6 +71,12 @@ manpageDir p
|
|||||||
buildDir :: FilePath
|
buildDir :: FilePath
|
||||||
buildDir = ".build"
|
buildDir = ".build"
|
||||||
|
|
||||||
|
pandocExe :: String
|
||||||
|
pandocExe = "pandoc"
|
||||||
|
|
||||||
|
pandocFiltersResolver :: String
|
||||||
|
pandocFiltersResolver = "--resolver lts-5.11"
|
||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main = do
|
main = do
|
||||||
|
|
||||||
@ -113,8 +119,7 @@ main = do
|
|||||||
md = out <.> "md"
|
md = out <.> "md"
|
||||||
tmpl = "doc/manpage.nroff"
|
tmpl = "doc/manpage.nroff"
|
||||||
need $ md : tmpl : pandocFilters
|
need $ md : tmpl : pandocFilters
|
||||||
cmd "pandoc" md "--to man -s --template" tmpl
|
cmd pandocExe md "--to man -s --template" tmpl
|
||||||
-- XXX assume these are compiled
|
|
||||||
"--filter tools/pandocRemoveHtmlBlocks"
|
"--filter tools/pandocRemoveHtmlBlocks"
|
||||||
"--filter tools/pandocRemoveHtmlInlines"
|
"--filter tools/pandocRemoveHtmlInlines"
|
||||||
"--filter tools/pandocRemoveLinks"
|
"--filter tools/pandocRemoveLinks"
|
||||||
@ -135,7 +140,7 @@ main = do
|
|||||||
|
|
||||||
pandocFilters |%> \out -> do
|
pandocFilters |%> \out -> do
|
||||||
need [out <.> "hs"]
|
need [out <.> "hs"]
|
||||||
cmd "stack ghc" out
|
cmd ("stack "++pandocFiltersResolver++" ghc") out
|
||||||
|
|
||||||
phony "clean" $ do
|
phony "clean" $ do
|
||||||
putNormal "Cleaning generated files"
|
putNormal "Cleaning generated files"
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
#!/usr/bin/env stack
|
#!/usr/bin/env stack
|
||||||
-- stack runghc --package pandoc-types
|
{- stack runghc --verbosity info --resolver lts-5.11 --package pandoc-types-1.16.1 -}
|
||||||
-- ^ installs pandoc-types in the current stack db when needed
|
|
||||||
|
|
||||||
import Text.Pandoc.JSON
|
import Text.Pandoc.JSON
|
||||||
import Text.Pandoc.Walk
|
import Text.Pandoc.Walk
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env stack
|
#!/usr/bin/env stack
|
||||||
-- stack runghc --package pandoc-types
|
{- stack runghc --verbosity info --resolver lts-5.11 --package pandoc-types-1.16.1 -}
|
||||||
|
|
||||||
import Text.Pandoc.JSON
|
import Text.Pandoc.JSON
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env stack
|
#!/usr/bin/env stack
|
||||||
-- stack runghc --package pandoc-types
|
{- stack runghc --verbosity info --resolver lts-5.11 --package pandoc-types-1.16.1 -}
|
||||||
|
|
||||||
import Text.Pandoc.JSON
|
import Text.Pandoc.JSON
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env stack
|
#!/usr/bin/env stack
|
||||||
-- stack runghc --package pandoc-types
|
{- stack runghc --verbosity info --resolver lts-5.11 --package pandoc-types-1.16.1 -}
|
||||||
|
|
||||||
import Text.Pandoc.JSON
|
import Text.Pandoc.JSON
|
||||||
|
|
||||||
@ -7,6 +7,6 @@ main :: IO ()
|
|||||||
main = toJSONFilter removeLinks
|
main = toJSONFilter removeLinks
|
||||||
|
|
||||||
removeLinks :: Inline -> [Inline]
|
removeLinks :: Inline -> [Inline]
|
||||||
removeLinks (Link l _) = l
|
removeLinks (Link _ is _) = is
|
||||||
removeLinks x = [x]
|
removeLinks x = [x]
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env stack
|
#!/usr/bin/env stack
|
||||||
-- stack runghc --package pandoc-types
|
{- stack runghc --verbosity info --resolver lts-5.11 --package pandoc-types-1.16.1 -}
|
||||||
|
|
||||||
import Text.Pandoc.Builder
|
import Text.Pandoc.Builder
|
||||||
import Text.Pandoc.JSON
|
import Text.Pandoc.JSON
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env stack
|
#!/usr/bin/env stack
|
||||||
-- stack runghc --package pandoc-types
|
{- stack runghc --verbosity info --resolver lts-5.11 --package pandoc-types-1.16.1 -}
|
||||||
|
|
||||||
import Text.Pandoc.JSON
|
import Text.Pandoc.JSON
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env stack
|
#!/usr/bin/env stack
|
||||||
-- stack runghc --package pandoc-types
|
{- stack runghc --verbosity info --resolver lts-5.11 --package pandoc-types-1.16.1 -}
|
||||||
|
|
||||||
import Text.Pandoc.Builder
|
import Text.Pandoc.Builder
|
||||||
import Text.Pandoc.JSON
|
import Text.Pandoc.JSON
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user