diff options
author | Vincent Ambo <v.ambo@me.com> | 2012-04-12T00·56+0200 |
---|---|---|
committer | Vincent Ambo <v.ambo@me.com> | 2012-04-12T00·56+0200 |
commit | 84b6f5b417920de46eed99df1942a76e66a0e72d (patch) | |
tree | 5b5b4b8ca227b78d8635081a7fe99d6391d7a3b8 /tools | |
parent | bb981085a6b7c11c479d7bc9ace6219ce8f8f311 (diff) |
* colouring tool changes
Diffstat (limited to 'tools')
-rw-r--r-- | tools/colouriser/colour.cabal | 4 | ||||
-rw-r--r-- | 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 c74e6f2da868..99a3c9cc03d0 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 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 |