Skip to content

Commit

Permalink
Codepen embed
Browse files Browse the repository at this point in the history
  • Loading branch information
Commander-lol committed Aug 13, 2016
1 parent 820177e commit d86f12b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ module.exports = {
Plugin: require('./lib/Plugin'),
extensions: {
youtube: require('./lib/plugins/youtube'),
codepen: require('./lib/plugins/codepen'),
},
}
20 changes: 20 additions & 0 deletions lib/plugins/codepen.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = function (code, opts) {
var themeId = opts.codepen.themeId;
var height = opts.codepen.height;
var defaultTab = opts.codepen.defaultTab;

return "<iframe " +
"height='"+height+"' " +
"scrolling='no' " +
"src='//codepen.io/Commander-lol/embed/preview/" + code + "/?height="+height+"&theme-id="+themeId+"&default-tab="+defaultTab+"&embed-version=2' " +
"frameborder='no' " +
"allowtransparency='true' " +
"allowfullscreen='true' " +
"style='width: 100%;'>" +
"See the Pen" +
"<a href='http://codepen.io/Commander-lol/pen/" + code + "/'>" +
"" + code + "" +
"</a>" +
"by Louis Capitanchik (<a href='http://codepen.io/Commander-lol'>@Commander-lol</a>)" +
"on <a href='http://codepen.io'>CodePen</a>"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "remarkable-embed",
"version": "0.2.3",
"version": "0.3.2",
"description": "Extensible Remarkable plugin for embedding content in markdown",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit d86f12b

Please sign in to comment.