JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 9971
  • Score
    100M100P100Q128670F
  • License MIT

Improved syntax for images in markdown

Package Exports

  • remark-images

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (remark-images) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

remark-images

Build Status lerna Join the community on Spectrum

Turn image urls into images with remark.

Installation

npm:

npm i -S remark-images

Usage

Say we have the following file, example.md:

#### A url

Below will render an image:

https://c8r-x0.s3.amazonaws.com/lab-components-macbook.jpg

And our script, example.js, looks as follows:

const vfile = require('to-vfile')
const remark = require('remark')
const images = require('remark-images')

remark()
  .use(images)
  .process(vfile.readSync('example.md'), function(err, file) {
    if (err) throw err
    console.log(String(file))
  })

Now, running node example yields:

#### A url

Below will render an image:

[![](https://c8r-x0.s3.amazonaws.com/lab-components-macbook.jpg)](https://c8r-x0.s3.amazonaws.com/lab-components-macbook.jpg)

API

remark().use(images)

Transform URLs in text that reference images (png, svg, jpg, jpeg, or gif) to images.

Supported urls / uris:

  • https://example.com/image.jpg
  • /image.jpg
  • ./image.jpg
  • ../image.jpg

Contribute

See contributing.md in mdx-js/mdx for ways to get started.

This organisation has a Code of Conduct. By interacting with this repository, organisation, or community you agree to abide by its terms.

License

MIT © Compositor and ZEIT