diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..3c3629e6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/Teams/TeamKoders/ABOUT.md b/Teams/TeamKoders/ABOUT.md new file mode 100644 index 00000000..04e4b41b --- /dev/null +++ b/Teams/TeamKoders/ABOUT.md @@ -0,0 +1,24 @@ +This is our page +================ + +We are the Koding team, so we are not really participating. But this page is here +to give you an idea about your own page. + + +About your team +=========================== +Tell us who you are, why you did you decide to join? + +Judges will read this page before making a final decision, so write your story, make it emotional and impressive. +Tell us why you want to win. + + +About your skills and what you are going to do? +======= +Don't reveal too much about your project, this is a competition but maybe +you can tell us the technologies, APIs you are going to use and what kind +of application you are going to build. + +You can change your mind, that's ok. Just push an update here when you do. + + diff --git a/Teams/TeamKoders/team.json b/Teams/TeamKoders/team.json new file mode 100644 index 00000000..0183ec79 --- /dev/null +++ b/Teams/TeamKoders/team.json @@ -0,0 +1,29 @@ +{ + "teamName": "Team Koders", + "members": [ + { + "name": "Emre", + "twitter": "emre", + "koding": "emre", + "location": "Istanbul, TR" + }, + { + "name": "Sinan", + "twitter": "sinan", + "koding": "sinan", + "lead": true + }, + { + "name": "Devrim", + "twitter": "devrim", + "koding": "devrim", + "location": "SF, US" + }, + { + "name": "Stefan", + "twitter": "stefanbc", + "koding": "stefanbc", + "location": "Romania" + } + ] +} diff --git a/gulpfile.coffee b/gulpfile.coffee new file mode 100644 index 00000000..edb1ba2f --- /dev/null +++ b/gulpfile.coffee @@ -0,0 +1,108 @@ +# +# # Gulpfile +# +path = require 'path' +gulp = require 'gulp' +concat = require 'gulp-concat' +replace = require 'gulp-replace' +tap = require 'gulp-tap' +util = require 'gulp-util' + + + +# The handler for gulp-tap +tap_json = (file, t) -> + filename = path.basename file.path + if filename is 'README.template.md' then return + + try + data = JSON.parse file.contents.toString() + catch e + util.log util.colors.red('Warning'), "Failed to parse json file. + Invalid JSON syntax. File: #{file.path}" + file.contents = new Buffer '' + return + + str = format_json data, file.path + if not str? + util.log util.colors.red('Warning'), "The JSON data couldn't be formatted + into the table for an unknown reason. File: #{file.path}" + file.contents = new Buffer '' + return + + # Everything is successful + file.contents = new Buffer str + + +# Format a member object into a link +format_member = (member) -> + "[#{member?.name}](https://koding.com/#{member?.koding})" + + + +# Format a data object, and return a string to be +# appended to the readme +format_json = (data, filepath) -> + teamPathName = path.basename path.dirname filepath + + # Get the lead, ahead of time. + teamLead = null + if data.members? and data.members instanceof Array + for member in data.members + if member.lead is true + teamLead = member + break + + output = '|' + # First column, #TeamName + if data.teamName? + output += " + + ##{data.teamName} + |" + else + output += " |" + + # Second column, TeamLead + if teamLead? + output += "#{format_member teamLead} |" + else + output += " |" + + # Third column, TeamMembers + if data.members? and data.members instanceof Array + for member in data.members + output += "#{format_member member} + #{member.location ? ''}
" + output += " |" + + # Fourth column, TeamPage + if data.teamName? then teamName = data.teamName + else teamName = teamPathName + output += " [#{teamName}](./Teams/#{teamPathName}/ABOUT.md) |" + + # Fifth column, Approved + # Faking for now + output += " |\n" + + # Return the final output + output + + + + +gulp.task 'run', -> + gulp.src [ + 'README.template.md' + './Teams/**/*.json' + ] + .pipe tap tap_json + .pipe concat 'README.md', newLine: '' + .pipe gulp.dest './' + +gulp.task 'default', ['run'] diff --git a/package.json b/package.json new file mode 100644 index 00000000..fc0bd71d --- /dev/null +++ b/package.json @@ -0,0 +1,11 @@ +{ + "private": true, + "devDependencies": { + "coffee-script": "^1.8.0", + "gulp": "^3.8.10", + "gulp-concat": "^2.4.2", + "gulp-replace": "^0.5.0", + "gulp-tap": "^0.1.3", + "gulp-util": "^3.0.1" + } +}