Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from Ward9250/futureproofing
Futureproofing - coffeescript - framework plugin system
- Loading branch information
Showing
12 changed files
with
431 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
fs = require 'fs' | ||
{spawn} = require 'child_process' | ||
|
||
buildlib = (callback) -> | ||
coffee = spawn 'coffee', ['-c', '-o', 'lib/', 'src/lib/'] | ||
coffee.stderr.on 'data', (data) -> | ||
process.stderr.write data.toString() | ||
coffee.stdout.on 'data', (data) -> | ||
console.log data.toString() | ||
coffee.on 'exit', (code) -> | ||
callback?() if code is 0 | ||
|
||
buildbin = (callback) -> | ||
coffee = spawn 'coffee', ['-c', '-o', 'bin/', 'src/bin/'] | ||
coffee.stderr.on 'data', (data) -> | ||
process.stderr.write data.toString() | ||
coffee.stdout.on 'data', (data) -> | ||
console.log data.toString() | ||
coffee.on 'exit', (code) -> | ||
callback?() if code is 0 | ||
|
||
task 'build', 'Build lib JS files from src directory', -> | ||
buildlib() | ||
buildbin() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env node | ||
|
||
require('./slidewinder.js'); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
yaml = require('js-yaml'); | ||
|
||
module.exports = { | ||
slidewinder: function(context){ | ||
slideData = context.data.root; | ||
var bodies = slideData.slides.map(function(x) { | ||
Object.keys(slideData.deck).forEach(function(key){ | ||
x.attributes[key] = slideData.deck[key]; | ||
}); | ||
completeBody = yaml.dump(x.attributes) + '\n' + x.body | ||
return completeBody; | ||
}); | ||
bodies.join('\n---\n'); | ||
return bodies.join('\n---\n'); | ||
} | ||
} |
File renamed without changes.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.