Skip to content

Commit d8b617e

Browse files
committedFeb 10, 2016
add a webpage!
1 parent eb64b21 commit d8b617e

8 files changed

+10019
-636
lines changed
 

‎.editorconfig

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
# insert_final_newline = true
9+
end_of_line = lf
10+
indent_style = space
11+
indent_size = 2

‎.versions

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
0.12.8
2-
0.12.9
3-
4.2.6
4-
5.2.0
5-
5.3.0
6-
5.4.1
1+
5.6.0
72
5.5.0
3+
5.4.1
4+
5.3.0
5+
5.2.0
6+
4.3.0
7+
4.2.6
8+
4.2.5
9+
0.12.10
10+
0.12.9
11+
0.12.8

‎build.js

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
var jade = require('jade');
2+
var fs = require('fs');
3+
4+
var testers = {};
5+
var _testers = require('./testers.json');
6+
Object.keys(_testers).forEach(path=>$set(testers, path, { path:path, code:_testers[path]}));
7+
8+
var data = {};
9+
var versions = fs.readFileSync('.versions').toString().trim().split('\n');
10+
versions.forEach(version=>
11+
data[version]=require('./results/'+version+'.json')
12+
);
13+
14+
15+
var html = jade.renderFile('index.jade', {
16+
pretty:true,
17+
versions:versions,
18+
results:data,
19+
testers:testers
20+
});
21+
22+
//console.log(data);
23+
fs.writeFileSync('index.html', html);
24+
25+
function $set(target, path, value) {
26+
var parts = path.split('›');
27+
28+
var obj = target;
29+
var last = parts.pop();
30+
31+
parts.forEach(function(prop) {
32+
if(!obj[prop]) obj[prop] = {};
33+
obj = obj[prop];
34+
});
35+
36+
obj[last] = value;
37+
}

‎extract.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var category;
66

77
function deindent(fn) {
88
var indent = /(?:^|\n)([\t ]+)[^\n]+/.exec(fn);
9-
return indent? fn.replace(new RegExp('\n' + indent[1], 'g'), '\n') : fn;
9+
return indent? fn.replace(new RegExp('\n' + indent[1], 'g'), '\n ') : fn;
1010
}
1111

1212
tests.forEach(function(test) {
@@ -27,7 +27,7 @@ tests.forEach(function(test) {
2727
}
2828

2929
function get_script(fn) {
30-
return (deindent(fn+"")).match(/[^]*\/\*([^]*)\*\/\}$/)[1];
30+
return deindent(fn+"").replace(/(\/\*)|( *\*\/ *)/g,'');
3131
}
3232
});
3333

‎index.html

+9,172
Large diffs are not rendered by default.

‎index.jade

+158
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
doctype html
2+
html
3+
head
4+
title
5+
block title
6+
| Node.js ES2015/ES6 support
7+
meta(http-equiv="Content-Type",content="text/html; charset=utf-8")
8+
link(href='http://fonts.googleapis.com/css?family=Raleway:400,700',rel='stylesheet',type='text/css')
9+
style.
10+
body {
11+
font-family: 'Raleway', sans-serif;
12+
color: #333;
13+
padding: 0;
14+
margin: 0;
15+
}
16+
header{
17+
background-color: #454545;
18+
color: #eee;
19+
padding: 3px 10px 6px;
20+
position: fixed;
21+
width: 100%;
22+
box-sizing: border-box;
23+
top: 0;
24+
}
25+
header h1{
26+
margin: 0;
27+
font-weight: normal;
28+
font-size: 1.5em;
29+
font-family: monospace;
30+
display: inline-block;
31+
}
32+
article {
33+
margin-top: 42px;
34+
}
35+
.category {
36+
background-color: #eee;
37+
font-weight: bold;
38+
padding: 3px;
39+
}
40+
.feature {
41+
width: 480px;
42+
min-width: 480px;
43+
}
44+
.result,.version {
45+
color: #fff;
46+
text-align: center;
47+
font-size: 12px;
48+
width: 65px;
49+
min-width: 65px;
50+
}
51+
.version {
52+
font-size: 16px;
53+
padding: 3px 1px;
54+
color: #aaa;
55+
}
56+
.subsub {
57+
text-indent: 10px;
58+
color: #aaa
59+
}
60+
.Yes {
61+
background-color: green;
62+
}
63+
.No {
64+
background-color: red;
65+
}
66+
.Error {
67+
background-color: #dd0000;
68+
}
69+
.v5 { background-color: darkgreen; }
70+
.v4 { background-color: seagreen; }
71+
.v0 { background-color: palegreen; }
72+
#headings {
73+
position: absolute;
74+
top: 16px;
75+
left: 484px;
76+
}
77+
body.scrolled #headings {
78+
position: fixed;
79+
top: -2px;
80+
}
81+
.code {
82+
font-family: monospace;
83+
text-indent: 0;
84+
background-color: #454545;
85+
border-radius: 6px;
86+
padding: 6px;
87+
position: absolute;
88+
display: none;
89+
margin-left: 8px;
90+
text-align: left;
91+
color: #eee;
92+
}
93+
.info {
94+
border-radius: 9px;
95+
background-color: #eee;
96+
color: #aaa;
97+
float: right;
98+
text-align: center;
99+
font-size: 12px;
100+
width: 18px;
101+
height: 18px;
102+
text-indent: 0;
103+
line-height: 18px;
104+
cursor: pointer;
105+
}
106+
.info:hover .code {
107+
display: inline-block;
108+
}
109+
.credits {
110+
position: absolute;
111+
right: 20px;
112+
top: 2px;
113+
font-size: 12px;
114+
margin-right: 20px;
115+
}
116+
header a {
117+
color: #eee;
118+
}
119+
.subheading {
120+
font-size: 10px;
121+
}
122+
body
123+
header
124+
h1 Node.js ES2015 Support
125+
.credits
126+
| Created by 
127+
a(href='https://github.com/williamkapke') William Kapke
128+
.subheading
129+
a(href='https://github.com/kangax/compat-table') kangax's compat-table
130+
|  applied only to Node.js
131+
table#headings
132+
tr
133+
each version in versions
134+
th.version(class='v'+version.split('.')[0])=version
135+
article
136+
each obj1, category in testers
137+
.category=category
138+
table
139+
each obj2, subcategory in obj1
140+
tr
141+
td.feature.sub=subcategory
142+
each obj3, subsubcategory in obj2
143+
tr
144+
td.feature.subsub
145+
| #{subsubcategory}
146+
if obj3.code
147+
.info
148+
| ?
149+
.code !{obj3.code.trim().replace(/\n/g, '<br>').replace(/ /g, '&nbsp;')}
150+
each version in versions
151+
if results[version]
152+
- result = results[version][obj3.path]
153+
- title = result===true? 'Test passed' : typeof result==='string'? result : 'Test failed'
154+
- result = result===true? 'Yes' : typeof result==='string'? 'Error' : 'No'
155+
td.result(class=result, title=title)
156+
| #{result}
157+
else
158+
td.result(class=result, title='No results yet')

‎package.json

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"dependencies": {
1414
"effd": "^1.4.5",
1515
"gift": "^0.7.0",
16+
"jade": "^1.11.0",
1617
"object.assign": "^3.0.1"
1718
}
1819
}

‎testers.json

+628-628
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.