git.iko.soy/typeable/pandoc
on master help sign in
Main: use Text.Pandoc to simplify list of imported modules.

git-svn-id: https://pandoc.googlecode.com/svn/trunk@689 788f1e2b-df1e-0410-8736-df70ead52e1b

commitba6efb0e484bc77055a46984de7a538289240b68 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateThu 12 Jul 2007, 08:31 (19 years ago) parenta9bd39b
1 file changed+9−24
src/Main.hs+9−24
src/Main.hs+9−24
@@ -29,26 +29,10 @@ Parses command-line options and calls the appropriate readers and
2929writers.
3030-}
3131module Main where
32−import Text.Pandoc.UTF8 ( decodeUTF8, encodeUTF8 )
33−import Text.Pandoc.Readers.Markdown ( readMarkdown )
34−import Text.Pandoc.Readers.HTML ( readHtml )
35−import Text.Pandoc.Writers.S5 ( writeS5String )
36−import Text.Pandoc.Writers.RST ( writeRST )
37−import Text.Pandoc.Readers.RST ( readRST )
32+import Text.Pandoc
33+import Text.Pandoc.UTF8 ( encodeUTF8, decodeUTF8 )
3834import Text.Pandoc.ASCIIMathML ( asciiMathMLScript )
39−import Text.Pandoc.Writers.HTML ( writeHtmlString )
40−import Text.Pandoc.Writers.Docbook ( writeDocbook )
41−import Text.Pandoc.Writers.LaTeX ( writeLaTeX )
42−import Text.Pandoc.Readers.LaTeX ( readLaTeX )
43−import Text.Pandoc.Writers.RTF ( writeRTF )
44−import Text.Pandoc.Writers.Man ( writeMan )
45−import Text.Pandoc.Writers.Markdown ( writeMarkdown )
46−import Text.Pandoc.Writers.DefaultHeaders ( defaultRTFHeader,
47− defaultS5Header,
48− defaultLaTeXHeader,
49− defaultDocbookHeader )
50−import Text.Pandoc.Definition
51−import Text.Pandoc.Shared
35+import Text.Pandoc.Shared ( joinWithSep, tabsToSpaces )
5236import Text.Regex ( mkRegex, matchRegex )
5337import System.Environment ( getArgs, getProgName, getEnvironment )
5438import System.Exit ( exitWith, ExitCode (..) )
@@ -159,13 +143,13 @@ options =
159143 (ReqArg
160144 (\arg opt -> return opt { optReader = map toLower arg })
161145 "FORMAT")
162− "" -- ("(" ++ (joinWithSep ", " (map fst readers)) ++ ")")
146+ "" -- ("(" ++ (joinWithSep ", " $ map fst readers) ++ ")")
163147
164148 , Option "tw" ["to","write"]
165149 (ReqArg
166150 (\arg opt -> return opt { optWriter = map toLower arg })
167151 "FORMAT")
168− "" -- ("(" ++ (joinWithSep ", " (map fst writers)) ++ ")")
152+ "" -- ("(" ++ (joinWithSep ", " $ map fst writers) ++ ")")
169153
170154 , Option "s" ["standalone"]
171155 (NoArg
@@ -321,8 +305,8 @@ options =
321305usageMessage :: String -> [OptDescr (Opt -> IO Opt)] -> String
322306usageMessage programName options = usageInfo
323307 (programName ++ " [OPTIONS] [FILES]" ++ "\nInput formats: " ++
324− joinWithSep ", " (map fst readers) ++ "\nOutput formats: " ++
325− joinWithSep ", " (map fst writers) ++ "\nOptions:")
308+ (joinWithSep ", " $ map fst readers) ++ "\nOutput formats: " ++
309+ (joinWithSep ", " $ map fst writers) ++ "\nOptions:")
326310 options
327311
328312-- Determine default reader based on source file extensions
@@ -494,7 +478,8 @@ main = do
494478 (readSources sources) >>= (hPutStr output . encodeUTF8 .
495479 (writer writerOptions) .
496480 (reader startParserState) . filter .
497− decodeUTF8 . (joinWithSep "\n")) >> hClose output
481+ decodeUTF8 . (joinWithSep "\n")) >>
482+ hClose output
498483
499484 where
500485 readSources [] = mapM readSource ["-"]