-
Notifications
You must be signed in to change notification settings - Fork 19
/
make-git-images.coffee
83 lines (79 loc) · 2.72 KB
/
make-git-images.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
console.log """Reminder:
1) Make sure gulp is running
2) run `sudo ldconfig /data/lib` before running this app
"""
Horseman = require 'node-horseman'
phantomjs = require('phantomjs-prebuilt')
# Custom action that creates an icon for each framework specified in the icons array
Horseman.registerAction 'createIcons', (icons)->
icons.reduce (promise, item) =>
promise.then =>
console.log " + Generating icon for #{item.title}"
# Call javascript to render new icon html
this.evaluate( (icon, title)->
makeIcon icon, title
, item.icon, item.title)
# Save an image screenshot of the div holding the icons
.crop('.github-icons', "./quickstart-icons/#{item.icon}.png")
, Promise.resolve()
# Storing these in case we ever make a change and want to generate again
generatedIcons = [
{icon:'rails', title:'Ruby on Rails'}
{icon:'sinatra', title:'Sinatra'}
{icon:'django', title:'Django'}
{icon:'flask', title:'Flask'}
{icon:'laravel', title:'Laravel'}
{icon:'codeigniter', title:'Codeigniter'}
{icon:'wordpress', title:'Wordpress'}
{icon:'meteor', title:'Meteor'}
{icon:'express', title:'Express'}
{icon:'sails', title:'Sails'}
{icon:'angular', title:'Angular'}
{icon:'ember', title:'Ember'}
{icon:'phoenix', title:'Phoenix'}
{icon:'lumen', title:'Lumen'}
{icon:'slim', title:'Slim'}
{icon:'cakephp', title:'CakePHP'}
{icon:'symfony', title:'Symfony'}
{icon:'hapi', title:'Hapi'}
{icon:'vue', title:'Vue'}
{icon:'nette', title:'Nette'}
{icon:'hanami', title:'Hanami'}
{icon:'ghost', title:'Ghost'}
{icon:'phalcon', title:'Phalcon'}
{icon:'silex', title:'Silex'}
{icon:'react', title:'React'}
{icon:'pyramid', title:'Pyramid'}
{icon:'bottle', title:'Bottle'}
{icon:'backbone', title:'Backbone'}
{icon:'denali', title:'Denali'}
{icon:'zf', title:'Zend Framework'}
{icon:'yii', title:'Yii'}
{icon:'revel', title:'Revel'}
{icon:'echo', title:'Echo'}
{icon:'iris', title:'Iris'}
{icon:'gin', title:'Gin'}
{icon:'beego', title:'Beego'}
{icon:'hugo', title:'Hugo'}
{icon:'trails', title:'Trails'}
{icon:'adonis', title:'Adonis'}
{icon:'totaljs', title:'Total.js'}
{icon:'keystonejs', title:'KeystoneJS'}
{icon:'feathers', title:'Feathers'}
{icon:'donejs', title:'DoneJS'}
{icon:'horizon', title:'Horizon'}
{icon:'koa', title:'Koa'}
{icon:'nodal', title:'Nodal'}
{icon:'buffalo', title:'Buffalo'}
{icon:'discourse', title:'Discourse'}
{icon:'firestorm', title:'Firestorm'}
]
# Add new icons to generate here:
newIcons = [
# ex : {icon:'rails', title:'Ruby on Rails'}
{icon:'play', title:'Play'}
]
horseman = new Horseman( {phantomPath:phantomjs.path} )
.open('http://localhost:8080/github-icons/index.html')
.createIcons newIcons
.close()