From 84b6f5b417920de46eed99df1942a76e66a0e72d Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 12 Apr 2012 02:56:33 +0200 Subject: [PATCH] * colouring tool changes --- tools/colouriser/colour.cabal | 4 ++-- tools/colouriser/colour.hs | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/tools/colouriser/colour.cabal b/tools/colouriser/colour.cabal index c74e6f2da..99a3c9cc0 100644 --- a/tools/colouriser/colour.cabal +++ b/tools/colouriser/colour.cabal @@ -7,7 +7,7 @@ Name: colour -- The package version. See the Haskell package versioning policy -- (http://www.haskell.org/haskellwiki/Package_versioning_policy) for -- standards guiding when and how versions should be incremented. -Version: 0.1 +Version: 0.2 -- A short (one-line) description of the package. Synopsis: Shortcut program to use HsColour @@ -61,4 +61,4 @@ Executable colour -- Extra tools (e.g. alex, hsc2hs, ...) needed to build the source. -- Build-tools: - \ No newline at end of file + diff --git a/tools/colouriser/colour.hs b/tools/colouriser/colour.hs index 03ae8d51f..3e6e39ba4 100644 --- a/tools/colouriser/colour.hs +++ b/tools/colouriser/colour.hs @@ -9,13 +9,16 @@ defineOptions "MainOptions" $ do stringOption "optFile" "file" "" "Name of the .hs file. Will be used for the HTML file as well" -colorCode :: String -> String -> IO () -colorCode input output = do +colorCode :: String -> IO () +colorCode input = do code <- readFile input - writeFile output $ hscolour False code + putStr $ concat [ "
" + , hscolour False code + , "
" + ] main :: IO () main = runCommand $ \opts args -> do let file = optFile opts unless (file == "") $ - colorCode (file ++ ".hs") (file ++ ".html") \ No newline at end of file + colorCode file \ No newline at end of file