Gathering detailed insights and metrics for remark-reference-links
Gathering detailed insights and metrics for remark-reference-links
Gathering detailed insights and metrics for remark-reference-links
Gathering detailed insights and metrics for remark-reference-links
@mcansh/remark-definition-links
This plugin is based on [remark-reference-links][reference-links] and [remark-defsplit][defsplit] in that it converts inline links to a definition list, but unlike remark-defsplit it puts them all at the bottom
remark-lint-no-shortcut-reference-link
remark-lint rule to warn when shortcut reference links are used
remark-html
remark plugin to compile Markdown to HTML
remark-lint-no-unneeded-full-reference-link
remark-lint rule to warn when full reference links are used if they can be collapsed
plugin to change links and images to references with separate definitions
npm install remark-reference-links
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
26 Stars
136 Commits
3 Forks
9 Watching
1 Branches
15 Contributors
Updated on 29 Sept 2024
Minified
Minified + Gzipped
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-23.2%
14,861
Compared to previous day
Last week
-0.5%
105,039
Compared to previous week
Last month
78.2%
398,716
Compared to previous month
Last year
114.8%
6,482,407
Compared to previous year
2
remark plugin to change links and images to references with separate definitions.
This package is a unified (remark) plugin to turn links ([text](url)
)
and images (![alt](url)
) into references ([text][id]
, ![alt][id]
) and
definitions ([id]: url
).
This project is useful when you want to transform markdown and prefer that it uses references and definitions. Long URLs in source code can make reading markdown difficult. References and definitions improve that by moving those URLs into definitions, outside of paragraphs.
This plugin is very similar to the alternative
remark-defsplit
.
The difference is that that plugin generates identifiers based on hostnames of
URLs and places definitions at the end of each section, whereas this plugin
generates numeric identifiers at the end of the document.
A different plugin, remark-inline-links
, does the
inverse: turn references and definitions into links and images.
This package is ESM only. In Node.js (version 16+), install with npm:
1npm install remark-reference-links
In Deno with esm.sh
:
1import remarkReferenceLinks from 'https://esm.sh/remark-reference-links@7'
In browsers with esm.sh
:
1<script type="module"> 2 import remarkReferenceLinks from 'https://esm.sh/remark-reference-links@7?bundle' 3</script>
Say we have the following file example.md
:
1# Pluto 2 3[![Build](https://github.com/solar-system/pluto/workflows/main/badge.svg)](https://github.com/solar-system/pluto/actions) 4 5## History 6 7In the 1840s, 8[Urbain Le Verrier](https://wikipedia.org/wiki/Urbain_Le_Verrier) used 9Newtonian mechanics to predict the position of the then-undiscovered planet 10[Neptune](https://wikipedia.org/wiki/Neptune) after analyzing perturbations 11in the orbit of [Uranus](https://wikipedia.org/wiki/Uranus).
And our module example.js
looks as follows:
1import {remark} from 'remark' 2import remarkReferenceLinks from 'remark-reference-links' 3import {read} from 'to-vfile' 4 5const file = await remark() 6 .use(remarkReferenceLinks) 7 .process(await read('example.md')) 8 9console.log(String(file))
…then running node example.js
yields:
1# Pluto 2 3[![Build][2]][1] 4 5## History 6 7In the 1840s, 8[Urbain Le Verrier][3] used 9Newtonian mechanics to predict the position of the then-undiscovered planet 10[Neptune][4] after analyzing perturbations 11in the orbit of [Uranus][5]. 12 13[1]: https://github.com/solar-system/pluto/actions 14 15[2]: https://github.com/solar-system/pluto/workflows/main/badge.svg 16 17[3]: https://wikipedia.org/wiki/Urbain_Le_Verrier 18 19[4]: https://wikipedia.org/wiki/Neptune 20 21[5]: https://wikipedia.org/wiki/Uranus
👉 Note: observe that definitions are added at the end of the document and that IDs are numeric identifiers.
This package exports no identifiers.
The default export is remarkReferenceLinks
.
unified().use(remarkReferenceLinks)
Change links and images to references with separate definitions.
There are no parameters.
Transform (Transformer
).
This package is fully typed with TypeScript. It exports no additional options.
Projects maintained by the unified collective are compatible with maintained versions of Node.js.
When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line, remark-reference-links@^7
,
compatible with Node.js 16.
This plugin works with unified
version 3+ and remark
version 4+.
Use of remark-reference-links
does not involve rehype (hast)
or user content so there are no openings for cross-site scripting
(XSS) attacks.
remark-defsplit
— transform links and images into references and definitions with numeric
IDsremark-inline-links
— transform references and definitions into normal links and imagesSee 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, organization, or community you agree to abide by its terms.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 1/30 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
Project has not signed or included provenance with any releases.
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More