kiruthiga 55473b7e7c initial push 5 дней назад
..
index.js 55473b7e7c initial push 5 дней назад
license 55473b7e7c initial push 5 дней назад
package.json 55473b7e7c initial push 5 дней назад
readme.md 55473b7e7c initial push 5 дней назад

readme.md

remark-reference-links

Build Coverage Downloads Size Sponsors Backers Chat

remark plugin to transform links and images into references and definitions.

Install

npm:

npm install remark-reference-links

Use

Say we have the following file, example.md:

[foo](http://example.com "Example Domain"), [foo](http://example.com "Example Domain"), [bar](http://example.com "Example Domain").

![foo](http://example.com "Example Domain"), ![foo](http://example.com "Example Domain"), ![bar](http://example.com "Example Domain").

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

var fs = require('fs')
var remark = require('remark')
var links = require('remark-reference-links')

remark()
  .use(links)
  .process(fs.readFileSync('example.md'), function(err, file) {
    if (err) throw err
    console.log(String(file))
  })

Now, running node example yields:

[foo][1], [foo][1], [bar][1].

![foo][1], ![foo][1], ![bar][1].

[1]: http://example.com "Example Domain"

API

remark().use(referenceLinks)

Plugin to transform links and images into references and definitions.

Related

  • remark-bookmarks — Link manager
  • remark-inline-links — Reverse of remark-reference-links, thus rewriting references and definitions into normal links and images
  • remark-defsplit — Practically the same as remark-inline-links, but with URI-based identifiers instead of numerical ones
  • remark-unlink — Remove all links, references and definitions

Contribute

See contributing.md in remarkjs/.github for ways to get started. See support.md for ways to get help.

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

License

MIT © Titus Wormer