Created
April 6, 2019 22:10
-
-
Save albertotb/a47025149ed550a3a3c3525b2da37ee2 to your computer and use it in GitHub Desktop.
Xaringan remark.js macros
This file contains hidden or 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
remark.macros.scale = function (percentage) { | |
var url = this; | |
return '<img src="' + url + '" style="width: ' + percentage + '" />'; | |
}; | |
remark.macros.vspace = function (percentage) { | |
return `<div style="height: ${percentage}%"></div>` | |
}; | |
remark.macros.centerScale = function (percentage) { | |
var url = this; | |
return `<div style="text-align:center;"> | |
<img src='${url}' style=width: ${percentage}%/> | |
</div>`; | |
}; | |
remark.macros.video = function(width, height) { | |
var url = this; | |
return `<video width="${width}" height="${height}"> | |
<source src="${url}" type="video/mp4"> | |
</video>` | |
} | |
remark.macros.colorText = function(color) { | |
const text = this; | |
return `<span style="color:${color}">${text}</span>` | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment