Navigation Menu

Skip to content

Commit

Permalink
adding macro to resize image in Remark.js. See issue gnab/remark#72
Browse files Browse the repository at this point in the history
  • Loading branch information
davidonlaptop committed Mar 23, 2015
1 parent 2f13285 commit 64cf0c3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mango.html
Expand Up @@ -12,6 +12,15 @@
</script>
<script type="text/javascript" src="remark.language.js"></script>
<script type="text/javascript">
remark.macros.scale = function (percentage) {
var url = this;
return '<img src="' + url + '" style="width: ' + percentage + '" />';
// Usage:
// ![:scale 50%](image.jpg)
// Outputs:
// <img src="image.jpg" style="width: 50%" />
};

var slideshow = remark.create({
sourceUrl: 'mango.md',
highlightStyle: 'monokai',
Expand Down

0 comments on commit 64cf0c3

Please sign in to comment.