{-# LANGUAGE Haskell2010, LambdaCase #-} module Main where import Control.Applicative import System.Environment import Text.Nicify main = getArgs >>= \case [] -> lhs2html <$> getContents >>= putStrLn args -> flip mapM_ args $ \f -> lhs2html <$> readFile f >>= writeFile (f ++ ".html") preamble = "\n\ \\n\ \
\n\ \ \n\ \\n\ \\n\ \\n\ \ \n" ++ codify True xs
codify True ('`' : xs) = "
" ++ codify False xs
codify flag (x : xs) = x : codify flag xs
codify _ _ = []