From ebcebccc3226eae6461fececdcca49fbdfb291e7 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Thu, 31 Jul 2008 23:16:31 +0000 Subject: Use utf8-string's System.IO.UTF8 to replace Text.Pandoc.UTF8. + removed Text/Pandoc/UTF8.hs + removed UTF8.hs notice from debian/copyright + adjusted main.hs, Text/Pandoc.hs, and Text/Pandoc/ODT.hs to use System.IO.UTF8 instead of Text.Pandoc.UTF8 + Added dependency on utf8-string to pandoc.cabal git-svn-id: https://pandoc.googlecode.com/svn/trunk@1347 788f1e2b-df1e-0410-8736-df70ead52e1b --- Main.hs | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'Main.hs') diff --git a/Main.hs b/Main.hs index 423cf35dc..fd303bc49 100644 --- a/Main.hs +++ b/Main.hs @@ -30,7 +30,6 @@ writers. -} module Main where import Text.Pandoc -import Text.Pandoc.UTF8 import Text.Pandoc.ODT import Text.Pandoc.Shared ( joinWithSep, HTMLMathMethod (..) ) import Text.Pandoc.Highlighting ( languages ) @@ -38,7 +37,9 @@ import System.Environment ( getArgs, getProgName, getEnvironment ) import System.Exit ( exitWith, ExitCode (..) ) import System.FilePath ( takeExtension, takeDirectory ) import System.Console.GetOpt -import System.IO +import Prelude hiding ( putStrLn, writeFile, readFile, getContents ) +import System.IO ( stdout, stderr ) +import System.IO.UTF8 import Data.Maybe ( fromMaybe ) import Data.Char ( toLower ) import Control.Monad ( (>>=) ) @@ -275,7 +276,7 @@ options = (\arg opt -> do let old = optIncludeInHeader opt text <- readFile arg - return opt { optIncludeInHeader = old ++ fromUTF8 text, + return opt { optIncludeInHeader = old ++ text, optStandalone = True }) "FILENAME") "" -- "File to include at end of header (implies -s)" @@ -285,7 +286,7 @@ options = (\arg opt -> do let old = optIncludeBeforeBody opt text <- readFile arg - return opt { optIncludeBeforeBody = old ++ fromUTF8 text }) + return opt { optIncludeBeforeBody = old ++ text }) "FILENAME") "" -- "File to include before document body" @@ -294,7 +295,7 @@ options = (\arg opt -> do let old = optIncludeAfterBody opt text <- readFile arg - return opt { optIncludeAfterBody = old ++ fromUTF8 text }) + return opt { optIncludeAfterBody = old ++ text }) "FILENAME") "" -- "File to include after document body" @@ -302,7 +303,7 @@ options = (ReqArg (\arg opt -> do text <- readFile arg - return opt { optCustomHeader = fromUTF8 text, + return opt { optCustomHeader = text, optStandalone = True }) "FILENAME") "" -- "File to use for custom header (implies -s)" @@ -555,10 +556,11 @@ main = do then putStrLn else writeFile outputFile . (++ "\n") - (readSources sources) >>= writeOutput . toUTF8 . - (writer writerOptions) . - (reader startParserState) . tabFilter tabStop . - fromUTF8 . (joinWithSep "\n") + (readSources sources) >>= writeOutput . + writer writerOptions . + reader startParserState . + tabFilter tabStop . + joinWithSep "\n" where readSources [] = mapM readSource ["-"] -- cgit v1.2.3