diff --git a/README.md b/README.md index b096bb8..852309e 100644 --- a/README.md +++ b/README.md @@ -27,10 +27,10 @@ var md = require('markdown-it')({ is interpreted as ```html -

+

test

``` -### Options +## Options #### Auto fill @@ -42,4 +42,42 @@ var md = require('markdown-it')({ }).use(require('markdown-it-imsize'), { autofill: true }); ``` -will fill the width and height fields automatically if the specified image path is valid. +will fill the width and height fields automatically if the specified image path is valid. + +Therefore, + +```js +![test](image.png) +``` + +is interpreted as + +```html +

test

+``` + +where ```image.png``` is a valid path and its size is 200 x 200. + +## Use with RequireJS + +```markdown-it-imsize``` is available with bower and RequireJS. First, you can install the package with, + +```shell +bower install markdown-it-imsize +``` + +Script for using ```markdown-it-imsize``` with RequireJS is as follows. + +```js +require(['require', 'MarkdownIt', 'MarkdownItImsize'], function(require) { + var md = require('MarkdownIt')({ + html: true, + linkify: true, + typography: true + }).use(require('MarkdownItImsize')); + + var rendered = md.render("![test](test.jpg =100x)"); + console.log(rendered); + document.getElementById('image-box').innerHTML = rendered; +}); +```