about summary refs log tree commit diff
path: root/tools/colouriser/colour.hs
diff options
context:
space:
mode:
authorVincent Ambo <v.ambo@me.com>2012-04-12T00·56+0200
committerVincent Ambo <v.ambo@me.com>2012-04-12T00·56+0200
commit84b6f5b417920de46eed99df1942a76e66a0e72d (patch)
tree5b5b4b8ca227b78d8635081a7fe99d6391d7a3b8 /tools/colouriser/colour.hs
parentbb981085a6b7c11c479d7bc9ace6219ce8f8f311 (diff)
* colouring tool changes
Diffstat (limited to 'tools/colouriser/colour.hs')
-rw-r--r--tools/colouriser/colour.hs11
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/colouriser/colour.hs b/tools/colouriser/colour.hs
index 03ae8d51f4e0..3e6e39ba45f6 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 [ "<div class=\"code\">"
+		     		, hscolour False code
+				    , "</div>"
+				    ]
 
 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