marked-imgix
v1.0.1
Published
marked renderer to generate imgix urls
Downloads
13
Maintainers
Readme
marked-imgix
marked / imgix renderer to generate imgix urls.
install
npm i --save marked-imgix
usage
import markedimgix from 'marked-imgix'
import marked from 'marked'
const renderer = new marked.Renderer()
renderer.image = markedImgix({
host: 'my-namespace.imgix.net'
secureURLToken: 'cU7USDTYcSYXm54wCAFP4CCeYGWERH4s'
})
marked(
'',
{ renderer }
)
// <img src="https://my-namespace.imgix.net/images/cat.jpg?w=400&h=300&fit=crop&ixlib=js-1.0.6&s=bc64e917bf149a05f6924405c879487e0" alt="image alt"> "image title"
quotes
The example above shows a problem you run into if trying to declare strings in js. The escaped quotes will work fine in this case.
In a markdown file, you can just use single quotes for string parameters.
compatibility
dist/index.js
should be fully compatible with node 6
Author
Levi Wheatcroft levi@wht.cr
Contributing
Contributions welcome; Please submit all pull requests against the master branch.