added all-filter which combines all filters into one ;)
This commit is contained in:
parent
42d2f005b3
commit
86ff15762f
30
app/All.hs
Normal file
30
app/All.hs
Normal 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]
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user