moved coloring to css file

This commit is contained in:
Spencer Florence 2014-12-30 14:07:21 -06:00
parent 94defd5fc2
commit c01a64fa42
2 changed files with 17 additions and 7 deletions

View File

@ -129,12 +129,12 @@
'((br ())))) '((br ()))))
(define (mode-xml mode body) (define (mode-xml mode body)
(define color (define class
(case mode (case mode
[(yes) "green"] [(yes) "covered"]
[(no) "red"] [(no) "uncovered"]
[(missing) "black"])) [(missing) "missing"]))
`(span ((style ,(string-append "color:" color))) ,@body)) `(span ((class ,class)) ,@body))
(module+ test (module+ test
(define (test file out) (define (test file out)
@ -145,5 +145,5 @@
(clear-coverage!)) (clear-coverage!))
(define f (path->string (simplify-path path))) (define f (path->string (simplify-path path)))
(test f (test f
`((span ((style "color:green")) `((span ((class "covered"))
,@(encode-string (file->string f)))))) ,@(encode-string (file->string f))))))

View File

@ -1,3 +1,13 @@
.code { .code {
font-family: "Lucida Console", Monaco, monospace; font-family: "Lucida Console", Monaco, monospace;
} }
.uncovered {
color:red;
}
.covered {
color:green;
}
.missing {}