added all-filter which combines all filters into one ;)

This commit is contained in:
Nicole Dresselhaus 2018-05-24 15:49:56 +02:00
parent 42d2f005b3
commit 86ff15762f
Signed by: Drezil
GPG Key ID: 057D94F356F41E25
3 changed files with 40 additions and 1 deletions

30
app/All.hs Normal file
View File

@ -0,0 +1,30 @@
#!/usr/bin/env runhaskell
{-# LANGUAGE ScopedTypeVariables #-}
import Control.Monad
import Text.Pandoc.JSON
import Text.Pandoc.Walk
import Text.Pandoc.Generic
import Text.Pandoc.Util.Filter.Quiz
import Text.Pandoc.Util.Filter.Cols
import Text.Pandoc.Util.Filter.Media
import Text.Pandoc.Util.Filter.Styling
main :: IO ()
main = toJSONFilter $
fmap (walk (concatMap quiz) :: Pandoc -> Pandoc) .
(walkM (fmap concat . mapM styling) :: Pandoc -> IO Pandoc) <=<
(walkM (fmap concat . mapM media) :: Pandoc -> IO Pandoc) .
(walk (concatMap quiz) :: Pandoc -> Pandoc) .
(topDown cols :: Pandoc -> Pandoc)
clean :: Block -> [Block]
clean (Plain []) = []
clean (Para []) = []
clean (LineBlock []) = []
clean (BlockQuote []) = []
clean (OrderedList _ []) = []
clean (BulletList []) = []
clean (DefinitionList []) = []
clean x = [x]

View File

@ -13,6 +13,15 @@ build-type: Simple
extra-source-files: README.md
cabal-version: >=1.10
executable all
hs-source-dirs: app
main-is: All.hs
ghc-options: -threaded -rtsopts -with-rtsopts=-N
build-depends: base
, pandoc-types
, pandoc-slide-filter
default-language: Haskell2010
executable media
hs-source-dirs: app
main-is: Media.hs

View File

@ -15,7 +15,7 @@
# resolver:
# name: custom-snapshot
# location: "./custom-snapshot.yaml"
resolver: lts-9.1
resolver: lts-11.9
# User packages to be built.
# Various formats can be used as shown in the example below.