1
1
mirror of https://github.com/github/semantic.git synced 2024-12-18 20:31:55 +03:00

Add a diff class to the table.

This commit is contained in:
Rob Rix 2015-12-07 12:12:52 -05:00
parent 8885f039c4
commit 6af10f07ed

View File

@ -31,6 +31,9 @@ showClassName _ = ""
tag :: String -> String -> String
tag name contents = "<" ++ name ++ ">" ++ contents ++ "</" ++ name ++ ">"
table :: String -> String
table contents = "<table class='diff'>" ++ contents ++ "</table>"
li :: HTML -> String
li (Text string) = string
li html = tag "li" $ show html
@ -51,7 +54,7 @@ split diff before after = return . pack
. tag "html"
. (tag "head" "<link rel='stylesheet' href='style.css'>" ++)
. tag "body"
. tag "table"
. table
. concat $ show <$> (fst $ diffToRows diff (0, 0) before after)
data Row = Row [HTML] [HTML]