mirror of
https://github.com/simonmichael/hledger.git
synced 2024-10-06 10:57:30 +03:00
Shake.hs, tools/pandoc-drop-html-inlines: switch to lua script filter
This commit is contained in:
parent
b83240ab6d
commit
79e46bb0fb
8
Shake.hs
8
Shake.hs
@ -84,8 +84,8 @@ main = do
|
||||
[
|
||||
--- "tools" </> "pandoc-demote-headers"
|
||||
--- "tools" </> "pandoc-drop-html-blocks"
|
||||
"tools" </> "pandoc-drop-html-inlines"
|
||||
,"tools" </> "pandoc-drop-links"
|
||||
--- "tools" </> "pandoc-drop-html-inlines"
|
||||
"tools" </> "pandoc-drop-links"
|
||||
,"tools" </> "pandoc-drop-notes"
|
||||
,"tools" </> "pandoc-drop-toc"
|
||||
]
|
||||
@ -205,7 +205,7 @@ main = do
|
||||
pandoc "-f markdown -s --template" tmpl
|
||||
-- "--filter tools/pandoc-drop-web-blocks"
|
||||
"--lua-filter tools/pandoc-drop-html-blocks.lua"
|
||||
"--filter tools/pandoc-drop-html-inlines"
|
||||
"--lua-filter tools/pandoc-drop-html-inlines.lua"
|
||||
"--filter tools/pandoc-drop-links"
|
||||
"--filter tools/pandoc-drop-notes"
|
||||
"-o" out
|
||||
@ -233,7 +233,7 @@ main = do
|
||||
pandoc "-f markdown"
|
||||
-- "--filter tools/pandoc-drop-web-blocks"
|
||||
"--lua-filter tools/pandoc-drop-html-blocks.lua"
|
||||
"--filter tools/pandoc-drop-html-inlines"
|
||||
"--lua-filter tools/pandoc-drop-html-inlines.lua"
|
||||
"--filter tools/pandoc-drop-links"
|
||||
"--filter tools/pandoc-drop-notes"
|
||||
"-t texinfo |"
|
||||
|
@ -1,12 +0,0 @@
|
||||
#!/usr/bin/env stack
|
||||
{- stack runghc --verbosity info --package pandoc-types -}
|
||||
|
||||
import Text.Pandoc.JSON
|
||||
|
||||
main :: IO ()
|
||||
main = toJSONFilter dropHtmlInlines
|
||||
|
||||
dropHtmlInlines :: Inline -> Inline
|
||||
dropHtmlInlines (RawInline (Format "html") _) = Str ""
|
||||
dropHtmlInlines x = x
|
||||
|
6
tools/pandoc-drop-html-inlines.lua
Normal file
6
tools/pandoc-drop-html-inlines.lua
Normal file
@ -0,0 +1,6 @@
|
||||
function RawInline(ri)
|
||||
if ri.format == "html"
|
||||
then return pandoc.Str("")
|
||||
else return ri
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user