# remark-defsplit **Repository Path**: mirrors_davidtheclark/remark-defsplit ## Basic Information - **Project Name**: remark-defsplit - **Description**: plugin to change links and images to references with separate definitions - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-08 - **Last Updated**: 2026-04-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # remark-defsplit [![Build][build-badge]][build] [![Coverage][coverage-badge]][coverage] [![Downloads][downloads-badge]][downloads] [![Size][size-badge]][size] [![Sponsors][sponsors-badge]][collective] [![Backers][backers-badge]][collective] [![Chat][chat-badge]][chat] [**remark**][remark] plugin to change links and images to references with separate definitions. ## Install [npm][]: ```sh npm install remark-defsplit ``` ## Use Say we have the following file, `example.md`. ```markdown [![Build Status](https://travis-ci.org/remarkjs/remark-defsplit.svg?branch=master)](https://travis-ci.org/remarkjs/remark-defsplit) ``` And our script, `example.js`, looks as follows: ```js var vfile = require('to-vfile') var remark = require('remark') var defsplit = require('remark-defsplit') remark() .use(defsplit, {id: ['travis-badge', 'travis']}) .process(vfile.readSync('example.md'), function(err, file) { if (err) throw err console.log(String(file)) }) ``` Now, running `node example` yields: ```markdown [![Build Status][travis-badge]][travis] [travis-badge]: https://travis-ci.org/remarkjs/remark-defsplit.svg?branch=master [travis]: https://travis-ci.org/remarkjs/remark-defsplit ``` ## API ### `remark().use(defsplit[, options])` Change links and images to references with separate definitions. ###### `options.id` Identifiers to use for new definitions instead of autogenerated ones (`string` or `Array.`, default: `[]`). ## Security Use of `remark-defsplit` does not involve [**rehype**][rehype] ([**hast**][hast]) or user content so there are no openings for [cross-site scripting (XSS)][xss] attacks. ## Related * [`remark-reference-links`][remark-reference-links] — Practically the same as `remark-defsplit`, but with numeric identifiers instead of URI-based ones * [`remark-inline-links`][remark-inline-links] — Reverse, thus rewriting references and definitions into links and images ## Contribute See [`contributing.md`][contributing] in [`remarkjs/.github`][health] for ways to get started. See [`support.md`][support] for ways to get help. This project has a [code of conduct][coc]. By interacting with this repository, organization, or community you agree to abide by its terms. ## License [MIT][license] © Eugene Sharygin [build-badge]: https://img.shields.io/travis/remarkjs/remark-defsplit/master.svg [build]: https://travis-ci.org/remarkjs/remark-defsplit [coverage-badge]: https://img.shields.io/codecov/c/github/remarkjs/remark-defsplit.svg [coverage]: https://codecov.io/github/remarkjs/remark-defsplit [downloads-badge]: https://img.shields.io/npm/dm/remark-defsplit.svg [downloads]: https://www.npmjs.com/package/remark-defsplit [size-badge]: https://img.shields.io/bundlephobia/minzip/remark-defsplit.svg [size]: https://bundlephobia.com/result?p=remark-defsplit [sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg [backers-badge]: https://opencollective.com/unified/backers/badge.svg [collective]: https://opencollective.com/unified [chat-badge]: https://img.shields.io/badge/chat-spectrum-7b16ff.svg [chat]: https://spectrum.chat/unified/remark [npm]: https://docs.npmjs.com/cli/install [health]: https://github.com/remarkjs/.github [contributing]: https://github.com/remarkjs/.github/blob/master/contributing.md [support]: https://github.com/remarkjs/.github/blob/master/support.md [coc]: https://github.com/remarkjs/.github/blob/master/code-of-conduct.md [license]: license [remark]: https://github.com/remarkjs/remark [remark-reference-links]: https://github.com/remarkjs/remark-reference-links [remark-inline-links]: https://github.com/remarkjs/remark-inline-links [xss]: https://en.wikipedia.org/wiki/Cross-site_scripting [rehype]: https://github.com/rehypejs/rehype [hast]: https://github.com/syntax-tree/hast