remarkjs / remark-rehype

plugin that turns markdown into HTML to support rehype
https://remark.js.org
MIT License
266 stars 18 forks source link

Example doesn't work, should show ESM code #20

Closed teinett closed 3 years ago

teinett commented 3 years ago

I tried the example code from readme.md:

var vfile = require('to-vfile')
var report = require('vfile-reporter')
var unified = require('unified')
var markdown = require('remark-parse')
var remark2rehype = require('remark-rehype')
var doc = require('rehype-document')
var format = require('rehype-format')
var html = require('rehype-stringify')

unified()
  .use(markdown)
  .use(remark2rehype)
  .use(doc)
  .use(format)
  .use(html)
  .process(vfile.readSync('example.md'), function (err, file) {
    console.error(report(err || file))
    console.log(String(file))
  })

It doesn't work.

Npm package to-vfile is ESM-only now: https://www.npmjs.com/package/to-vfile.

Please, update the code of the example to have it correctly written for beginners.

wooorm commented 3 years ago

Hi there. We‘re working through hundreds of projects. It’ll take some time. See https://github.com/unifiedjs/unified/issues/121 for more information. I’ll close this for now, I’ll get to it when I can.

github-actions[bot] commented 3 years ago

Hi! Thanks for taking the time to contribute! This has been marked by a maintainer as needing more info. It’s not clear yet whether this is an issue. Here are a couple tips:

Thanks, — bb