* colouring tool changes
This commit is contained in:
parent
bb981085a6
commit
84b6f5b417
2 changed files with 9 additions and 6 deletions
|
|
@ -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")
|
||||
colorCode file
|
||||
Loading…
Add table
Add a link
Reference in a new issue