@@ -1,30 +0,0 @@
1−
2−import Control.Arrow
3−import Data.Foldable
4−import Data.List
5−import System.Environment
6−
7−main = do
8− files <- getArgs
9− forM_ files $ \ file -> do
10− convertM file
11−
12−convertM :: FilePath -> IO ()
13−convertM file = do
14− contents <- readFile file
15− seq (length contents) (return ())
16− writeFile file (convert contents)
17−
18−convert :: String -> String
19−convert =
20− lines >>>
21− groupBy (\ a b -> take 1 a == take 1 b) >>>
22− map go >>>
23− concat >>>
24− unlines
25− where
26− go :: [String] -> [String]
27− go (a : r)
28− | ">" `isPrefixOf` a
29− = "``` haskell ignore" : map (drop 2) (a : r) ++ "```" : []
30− go x = x