diff options
-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 |