Skip to content

Commit a9133f6

Browse files
committed
init badge table stuff
0 parents  commit a9133f6

File tree

9 files changed

+169
-0
lines changed

9 files changed

+169
-0
lines changed

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
.DS_Store*
3+
*.log
4+
*.gz
5+
6+
node_modules
7+
coverage

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
The MIT License (MIT)
3+
4+
Copyright (c) 2014 The jshttp team and contributors
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in
14+
all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
THE SOFTWARE.

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
index.html: src/index.jade src/maintainers.json src/projects.json
3+
@node src/build.js

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!DOCTYPE html><html class="no-js"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><title>jshttp</title><meta name="description" content=""><meta name="viewport" content="width=device-width, initial-scale=1"></head><body><h1>jshttp</h1><table><thead><tr><th>Project Name</th><th>Lead Maintainer</th><th></th><th></th><th></th><th></th></tr></thead><tbody><tr><td><a href="https://github.com/jshttp/vary">Vary</a></td><td><a href="https://github.com/dougwilson">Doug Wilson</a></td><td><a href="https://www.npmjs.org/package/vary"><img src="http://img.shields.io/npm/v/vary.svg?style=flat"/></a></td><td><a href="http://nodejs.org/download/"><img src="http://img.shields.io/badge/node.js-&gt;=_0.8-blue.svg?style=flat"/></a></td><td><a href="https://travis-ci.org/jshttp/vary"><img src="http://img.shields.io/travis/jshttp/vary.svg?style=flat"/></a></td><td><a href="https://coveralls.io/r/jshttp/vary"><img src="https://img.shields.io/coveralls/jshttp/vary.svg?style=flat"/></a></td><td><a href="https://www.gittip.com/dougwilson"><img src="http://img.shields.io/gittip/dougwilson.svg?style=flat"/></a></td></tr><tr><td><a href="https://github.com/jshttp/on-headers">on-headers</a></td><td><a href="https://github.com/dougwilson">Doug Wilson</a></td><td><a href="https://www.npmjs.org/package/on-headers"><img src="http://img.shields.io/npm/v/on-headers.svg?style=flat"/></a></td><td><a href="http://nodejs.org/download/"><img src="http://img.shields.io/badge/node.js-&gt;=_0.8-blue.svg?style=flat"/></a></td><td><a href="https://travis-ci.org/jshttp/on-headers"><img src="http://img.shields.io/travis/jshttp/on-headers.svg?style=flat"/></a></td><td><a href="https://coveralls.io/r/jshttp/on-headers"><img src="https://img.shields.io/coveralls/jshttp/on-headers.svg?style=flat"/></a></td><td><a href="https://www.gittip.com/dougwilson"><img src="http://img.shields.io/gittip/dougwilson.svg?style=flat"/></a></td></tr></tbody></table></body></html>

package.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "jshttp.github.io",
3+
"description": "",
4+
"private": true,
5+
"version": "0.0.0",
6+
"author": {
7+
"name": "Jonathan Ong",
8+
"email": "[email protected]",
9+
"url": "http://jongleberry.com",
10+
"twitter": "https://twitter.com/jongleberry"
11+
},
12+
"license": "MIT",
13+
"repository": "jshttp/jshttp.github.io",
14+
"devDependencies": {
15+
"jade": "1"
16+
}
17+
}

src/build.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
var fs = require('fs')
3+
var path = require('path')
4+
var jade = require('jade')
5+
6+
var index = path.join(__dirname, 'index.jade')
7+
var out = path.join(__dirname, '../index.html')
8+
9+
var projects = require('./projects.json')
10+
var maintainers = require('./maintainers.json')
11+
12+
// normalize the metadata
13+
projects.forEach(function (project) {
14+
project.npm = project.npm || project.name.toLowerCase()
15+
project.repo = project.repo || ('jshttp/' + project.npm)
16+
project.node = project.node || '0.8'
17+
project.maintainer = maintainers[project.maintainer || 'dougwilson']
18+
})
19+
20+
var src = fs.readFileSync(index, 'utf8')
21+
22+
var fn = jade.compile(src, {
23+
compileDebug: false,
24+
filename: index,
25+
})
26+
27+
var html = fn({
28+
projects: projects
29+
})
30+
31+
fs.writeFileSync(out, html)

src/index.jade

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
2+
mixin table(projects)
3+
table
4+
thead
5+
tr
6+
th Project Name
7+
th Lead Maintainer
8+
th
9+
th
10+
th
11+
th
12+
tbody
13+
for project in projects
14+
+row(project)
15+
16+
mixin row(project)
17+
tr
18+
td: +project(project)
19+
td: +maintainer(project.maintainer)
20+
td: +badge-npm(project.npm)
21+
td: +badge-version(project.node)
22+
td: +badge-travis(project.repo)
23+
td: +badge-coverage(project.repo)
24+
td: +badge-gittip(project.maintainer.github)
25+
26+
mixin project(project)
27+
a(href='https://github.com/' + project.repo)= project.name
28+
29+
mixin maintainer(person)
30+
a(href='https://github.com/' + person.github)= person.name
31+
32+
mixin badge-npm(name)
33+
a(href='https://www.npmjs.org/package/' + name)
34+
img(src='http://img.shields.io/npm/v/' + name + '.svg?style=flat')
35+
36+
mixin badge-version(version)
37+
//- probably want different colors for different versions
38+
a(href='http://nodejs.org/download/')
39+
img(src='http://img.shields.io/badge/node.js->=_' + version + '-blue.svg?style=flat')
40+
41+
mixin badge-travis(repo)
42+
a(href='https://travis-ci.org/' + repo)
43+
img(src='http://img.shields.io/travis/' + repo + '.svg?style=flat')
44+
45+
mixin badge-coverage(repo)
46+
a(href='https://coveralls.io/r/' + repo)
47+
img(src='https://img.shields.io/coveralls/' + repo + '.svg?style=flat')
48+
49+
mixin badge-gittip(user)
50+
a(href='https://www.gittip.com/' + user)
51+
img(src='http://img.shields.io/gittip/' + user + '.svg?style=flat')
52+
53+
doctype
54+
html.no-js
55+
head
56+
meta(charset='utf-8')
57+
meta(http-equiv='X-UA-Compatible', content='IE=edge')
58+
title jshttp
59+
meta(name='description', content='')
60+
meta(name='viewport', content='width=device-width, initial-scale=1')
61+
body
62+
h1 jshttp
63+
64+
+table(projects)
65+
66+
//- Google Analytics: change UA-XXXXX-X to be your site's ID.
67+
//-
68+
script
69+
(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
70+
function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
71+
e=o.createElement(i);r=o.getElementsByTagName(i)[0];
72+
e.src='//www.google-analytics.com/analytics.js';
73+
r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
74+
ga('create','UA-XXXXX-X');ga('send','pageview');

src/maintainers.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"dougwilson": {
3+
"name": "Doug Wilson",
4+
"github": "dougwilson"
5+
}
6+
}

src/projects.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[
2+
{
3+
"name": "vary"
4+
},
5+
{
6+
"name": "on-headers"
7+
}
8+
]

0 commit comments

Comments
 (0)