Skip to content

Commit

Permalink
Merge pull request #9 from Ward9250/futureproofing
Browse files Browse the repository at this point in the history
Futureproofing
- coffeescript
- framework plugin system
  • Loading branch information
Richard Smith-Unna committed Nov 25, 2015
2 parents f50cb37 + c04d6c0 commit 5390af9
Show file tree
Hide file tree
Showing 12 changed files with 431 additions and 189 deletions.
24 changes: 24 additions & 0 deletions Cakefile
@@ -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()
3 changes: 3 additions & 0 deletions bin/cmdline.js
@@ -0,0 +1,3 @@
#!/usr/bin/env node

require('./slidewinder.js');
56 changes: 33 additions & 23 deletions bin/slidewinder.js 100755 → 100644

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions extensions/frameworks/remark/helpers.js
@@ -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.
92 changes: 48 additions & 44 deletions lib/log.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

121 changes: 0 additions & 121 deletions lib/slidewinder.js

This file was deleted.

0 comments on commit 5390af9

Please sign in to comment.