it
Version:
A testing framework for node
58 lines (51 loc) • 1.59 kB
HTML
<html>
<head>
<title>It Doc Reporter</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<style>
body {
font: 16px/1.6 "Helvetica Neue", arial, sans-serif;
padding: 60px;
}
pre {
font-size: 14px;
line-height: 1.3
}
code .init {
color: #f47918
}
code .string {
color: #f90000
}
code .keyword {
color: #f40d88
}
code .number {
color: #2f6fad
}
code .identifier {
color: #636364
}
</style>
<script>
$(function () {
$('code').each(function () {
$(this).html(highlight($(this).text()));
});
});
function highlight(js) {
return js
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/\/\/(.*)/gm, '<span class="comment">//$1</span>')
.replace(/('[^'|\\']*')/gm, '<span class="string">$1</span>')
.replace(/(\d+\.\d+)/gm, '<span class="number">$1</span>')
.replace(/(\d+)/gm, '<span class="number">$1</span>')
.replace(/\bnew +(\w+)/gm, '<span class="keyword">new</span> <span class="init">$1</span>')
.replace(/\b(function|new|throw|return|var|if|else) +\b/gm, '<span class="keyword">$1</span> ');
}
</script>
</head>
<body>
<h1>It Doc</h1>