From 86ff15762f922a1004acef60c2dc4563d674a6ef Mon Sep 17 00:00:00 2001 From: Stefan Dresselhaus Date: Thu, 24 May 2018 15:49:56 +0200 Subject: [PATCH] added all-filter which combines all filters into one ;) --- app/All.hs | 30 ++++++++++++++++++++++++++++++ pandoc-slide-filter.cabal | 9 +++++++++ stack.yaml | 2 +- 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 app/All.hs diff --git a/app/All.hs b/app/All.hs new file mode 100644 index 0000000..2073cb6 --- /dev/null +++ b/app/All.hs @@ -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] + diff --git a/pandoc-slide-filter.cabal b/pandoc-slide-filter.cabal index 5fe8bb6..853d246 100644 --- a/pandoc-slide-filter.cabal +++ b/pandoc-slide-filter.cabal @@ -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 diff --git a/stack.yaml b/stack.yaml index 257a646..f618f5d 100644 --- a/stack.yaml +++ b/stack.yaml @@ -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.