|
|
vor 5 Tagen | |
|---|---|---|
| .. | ||
| index.js | vor 5 Tagen | |
| license | vor 5 Tagen | |
| package.json | vor 5 Tagen | |
| readme.md | vor 5 Tagen | |
remark plugin to transform links and images into references and definitions.
npm:
npm install remark-reference-links
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").
, , .
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"
remark().use(referenceLinks)Plugin to transform links and images into references and definitions.
remark-bookmarks
— Link managerremark-inline-links
— Reverse of remark-reference-links, thus rewriting references and
definitions into normal links and imagesremark-defsplit
— Practically the same as remark-inline-links, but with URI-based
identifiers instead of numerical onesremark-unlink
— Remove all links, references and definitionsSee 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.