Alessandro Vermeulen Alessandro Vermeulen's blog about languages, programming, Computer Science and the Web.

SyntaxHighlighter Evolved – Extra

This page is intended as the placeholder for my extensions on the SyntaxHighlighter Evolved. Currently it contains an approximation of a TextMate theme. The theme is tailored to the needs of the Haskell brush specifically so it might give some odd results in combination with other brushes.

github (git repository)

main = do args <- getArgs
          let (Instance prog space pos heading) = getInstance (tupelize args)
          spaceString <- readFile space
          let space = getSpace (parse parseSpace spaceString)
          programCode <- readFile prog
          driver (toEnvironment programCode)
                 (ArrowState space pos heading [Ident "start"])
  where
    tupelize [] = []
    tupelize [x] = [("_",x)]
    tupelize (x:y:xs) = (tail x,y) : tupelize xs
    getInstance args = Instance (find "p") (find "e") (read $ find "s")
                                (read $ find "h")
      where find p = case lookup p args of
                       Just a  -> a
                       Nothing -> error ("Could not find argument `" ++ p ++ "'"
                                           ++ "\n" ++ usage)
    getSpace sp | null xs   = error "You did not input a valid space!"
                | otherwise = (fst.head) xs
      where xs = filter (null.snd) sp
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.