-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
54 additions
and
34 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,22 @@ | ||
'use strict'; | ||
|
||
var parser = require('swig/lib/parser'); | ||
var helpers = require('swig/lib/helpers'); | ||
|
||
module.exports = (function() { | ||
|
||
var gist = function() { | ||
var id = parser.parseVariable(this.args[0]); | ||
var output = [ | ||
'(function() {', | ||
helpers.setVar('__id', id), | ||
'_output += \'<script src="https://gist.github.com/\' + __id + \'.js"></script>\';', | ||
'})();' | ||
]; | ||
return output.join(''); | ||
}; | ||
|
||
gist.ends = false; | ||
|
||
return gist; | ||
}()); |
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,30 @@ | ||
'use strict'; | ||
|
||
var parser = require('swig/lib/parser'); | ||
var helpers = require('swig/lib/helpers'); | ||
|
||
module.exports = (function() { | ||
|
||
var youtube = function() { | ||
var id = parser.parseVariable(this.args[0]); | ||
//var width = (this.args[1]) ? parser.parseVariable(this.args[1]) : 560; | ||
//var height = (this.args[2]) ? parser.parseVariable(this.args[2]) : 315; | ||
|
||
var output = [ | ||
'(function() {', | ||
helpers.setVar('__id', id), | ||
//helpers.setVar('__width', width), | ||
//helpers.setVar('__height', height), | ||
'_output += \'<iframe width="560" height="315" \';', | ||
'_output += \'src="http://www.youtube.com/embed/\' + __id + \'?rel=0" \';', | ||
'_output += \'frameborder="0" allowfullscreen></iframe>\';', | ||
'})();' | ||
]; | ||
return output.join(''); | ||
}; | ||
|
||
youtube.ends = false; | ||
|
||
return youtube; | ||
|
||
}()); |
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 |
---|---|---|
@@ -1,36 +1,4 @@ | ||
'use strict'; | ||
|
||
var parser = require('swig/lib/parser'); | ||
var helpers = require('swig/lib/helpers'); | ||
|
||
exports.gist = function() { | ||
var id = parser.parseVariable(this.args[0]); | ||
var output = [ | ||
'(function() {', | ||
helpers.setVar('__id', id), | ||
'_output += \'<script src="https://gist.github.com/\' + __id + \'.js"></script>\';', | ||
'})();' | ||
]; | ||
return output.join(''); | ||
}; | ||
exports.gist.ends = false; | ||
|
||
exports.youtube = function() { | ||
var id = parser.parseVariable(this.args[0]); | ||
//var width = (this.args[1]) ? parser.parseVariable(this.args[1]) : 560; | ||
//var height = (this.args[2]) ? parser.parseVariable(this.args[2]) : 315; | ||
|
||
var output = [ | ||
'(function() {', | ||
helpers.setVar('__id', id), | ||
//helpers.setVar('__width', width), | ||
//helpers.setVar('__height', height), | ||
'_output += \'<iframe width="560" height="315" \';', | ||
'_output += \'src="http://www.youtube.com/embed/\' + __id + \'?rel=0" \';', | ||
'_output += \'frameborder="0" allowfullscreen></iframe>\';', | ||
'})();' | ||
]; | ||
return output.join(''); | ||
}; | ||
|
||
exports.youtube.ends = false; | ||
exports.gist = require(__dirname + '/plugins/gist'); | ||
exports.youtube = require(__dirname + '/plugins/youtube'); |