hledger/tools/pandoc-demote-headers.hs

15 lines
315 B
Haskell
Raw Normal View History

2016-04-07 19:04:39 +03:00
#!/usr/bin/env stack
{- stack runghc --verbosity info --package pandoc-types -}
2016-04-07 19:04:39 +03:00
import Text.Pandoc.JSON
import Text.Pandoc.Walk
import Data.Char (toUpper)
main :: IO ()
main = toJSONFilter demoteHeaders
demoteHeaders :: Block -> Block
demoteHeaders (Header l attr xs) = Header (l+1) attr xs
demoteHeaders x = x