0.1.0 • Published 8 years ago
markdown-it-imgix v0.1.0
markdown-it-imgix
Apply an imgix domain and parameters to markdown images.
Install
$ npm install markdown-it-imgix --save
Usage
const Markdown = require("markdown-it");
const imgix = require("markdown-it");
const md = new Markdown().use(imgix, {
match: "/example/path",
domain: "example.imgix.net"
});
const str = `text with\n\n![](/another/path/img.png)\n\n![](/example/path/fig.png)\n\nanother paragraph`
const res = md.render(str);
console.log(res);
Options
You can supply either a single object with the following params, or an array of objects to perform multiple replacements.
match
: (required) url / path patterns to match for replacementdomain
: (required) imgix domain that will replace the matchparams
: imgix api params to apply for this matchsecureUrl
: if you want to use https and have a ssl-enabled imgix domain
0.1.0
8 years ago