From 6f5a6cd7353b8ff8243c86df75432780ba643944 Mon Sep 17 00:00:00 2001 From: ache Date: Tue, 6 Feb 2018 05:33:32 +0100 Subject: no pandoc dependencies --- src/articleFilter.hs | 55 ---------------------------------------------------- 1 file changed, 55 deletions(-) delete mode 100644 src/articleFilter.hs (limited to 'src/articleFilter.hs') diff --git a/src/articleFilter.hs b/src/articleFilter.hs deleted file mode 100644 index a94cd3d..0000000 --- a/src/articleFilter.hs +++ /dev/null @@ -1,55 +0,0 @@ -import Text.Pandoc -import Text.Pandoc.JSON -import Control.Monad.State -import Id - - -{- - - Écrit par Hédy GIRAUDEAU - - 27/07/17 --} -extractStart :: [Inline] -> ([Inline],[Inline]) -extractStart [] = ([],[]) -extractStart ((SoftBreak):q) = ((SoftBreak):y, z) where (y,z) = (extractStart q) -extractStart ((LineBreak):q) = ((LineBreak):y, z) where (y,z) = (extractStart q) -extractStart (img@(Image _ _ _):q) = (img: y, z) where (y,z) = (extractStart q) -extractStart x = ([],x) - - - - -transformBlock cnt ( hdF@(Header 1 _ inlines) : paraF@(Para inlinesP) : blocks ) = - return (( (RawBlock (Format "html") - ( start_header ) - ) : hdF : - (RawBlock (Format "html") - ( end_header ) - ) : (Plain inlinesP) : - (RawBlock (Format "html") - ( end_intro ) - ) : blocks - ) ++ [ (RawBlock (Format "html") - (end_article) ) - ]) - where start_header = "
" - end_header = "
" - end_intro = "" - end_article = "
" - ---transformBlock _ ((Para inlines):tl) = --- return ((Plain plainInline):(Para paraInline:tl)) --- where (plainInline, paraInline) = extractStart(inlines) - - -transformBlock _ x = return x - - -bar :: Pandoc -> IO Pandoc -bar x = do cnt <- newId - bottomUpM (transformBlock cnt) x - -main :: IO() -main = toJSONFilter bar - - --- vim:set et: -- cgit v1.2.3-54-g00ecf