remark-autolink-headings
Advanced tools
Comparing version 5.2.0 to 5.2.1
{ | ||
"name": "remark-autolink-headings", | ||
"version": "5.2.0", | ||
"description": "Automatically add links to headings in Markdown.", | ||
"version": "5.2.1", | ||
"description": "remark plugin to automatically add links to headings", | ||
"license": "MIT", | ||
"keywords": [ | ||
"unified", | ||
"remark", | ||
"plugin", | ||
"mdast", | ||
"markdown", | ||
"headings", | ||
"link", | ||
"automatic", | ||
"markdown", | ||
"remark" | ||
"automatic" | ||
], | ||
@@ -24,3 +27,3 @@ "repository": "remarkjs/remark-autolink-headings", | ||
"dist", | ||
"src" | ||
"src/index.js" | ||
], | ||
@@ -32,24 +35,29 @@ "dependencies": { | ||
"devDependencies": { | ||
"@babel/cli": "^7.1.2", | ||
"@babel/core": "^7.1.2", | ||
"@babel/preset-env": "^7.1.0", | ||
"@babel/cli": "^7.0.0", | ||
"@babel/core": "^7.0.0", | ||
"@babel/preset-env": "^7.0.0", | ||
"@babel/register": "^7.0.0", | ||
"ava": "1.0.0-rc.2", | ||
"ava": "2.0.0", | ||
"babel-plugin-add-module-exports": "^1.0.0", | ||
"browserify": "^16.0.0", | ||
"nyc": "^14.0.0", | ||
"prettier": "^1.14.3", | ||
"prettier": "^1.0.0", | ||
"remark": "^10.0.0", | ||
"remark-cli": "^6.0.0", | ||
"remark-html": "^9.0.0", | ||
"remark-slug": "^5.1.0", | ||
"remark-preset-wooorm": "^4.0.0", | ||
"remark-preset-wooorm": "^5.0.0", | ||
"remark-slug": "^5.0.0", | ||
"tinyify": "^2.0.0", | ||
"xo": "^0.24.0" | ||
}, | ||
"scripts": { | ||
"prepublishOnly": "npm run build", | ||
"build": "babel src --out-dir dist --ignore src/**/__tests__", | ||
"prepublishOnly": "npm run compile", | ||
"format": "remark . -qfo && prettier \"**/*.js\" --write && xo --fix", | ||
"compile": "babel src --out-dir dist --ignore src/**/__tests__", | ||
"build-bundle": "browserify . -s remarkAutolinkHeadings -o remark-autolink-headings.js", | ||
"build-mangle": "browserify . -s remarkAutolinkHeadings -p tinyify -o remark-autolink-headings.min.js", | ||
"bundle": "npm run build-bundle && npm run build-mangle", | ||
"test-api": "ava", | ||
"test-coverage": "nyc --reporter lcov ava", | ||
"test": "npm run build && npm run format && npm run test-coverage" | ||
"test": "npm run compile && npm run format && npm run bundle && npm run test-coverage" | ||
}, | ||
@@ -56,0 +64,0 @@ "browserslist": "> 2.5%, node 6", |
@@ -6,21 +6,23 @@ # remark-autolink-headings | ||
[![Downloads][downloads-badge]][downloads] | ||
[![Chat][chat-badge]][chat] | ||
[![Size][size-badge]][size] | ||
[![Sponsors][sponsors-badge]][collective] | ||
[![Backers][backers-badge]][collective] | ||
[![Chat][chat-badge]][chat] | ||
Automatically add links to headings with [**remark**][remark]. | ||
[**remark**][remark] plugin to automatically add links to headings. | ||
This package integrates with [remark-html][remark-html]. | ||
It may be better to work with [**rehype**][rehype], which is specifically made | ||
for HTML, and to use [rehype-autolink-headings][] instead of this package. | ||
> This package integrates with [`remark-html`][remark-html]. | ||
> It may be better to work with [**rehype**][rehype], which is specifically made | ||
> for HTML, and to use [`rehype-autolink-headings`][rehype-autolink-headings] | ||
> instead of this package. | ||
## Installation | ||
## Install | ||
[npm][]: | ||
```bash | ||
```sh | ||
npm install remark-autolink-headings | ||
``` | ||
## Example | ||
## Use | ||
@@ -39,3 +41,3 @@ Say we have the following markdown file, `example.md`: | ||
```javascript | ||
```js | ||
const fs = require('fs') | ||
@@ -51,3 +53,3 @@ const unified = require('unified') | ||
.use(slug) | ||
// Note that this module must be included after remark-slug. | ||
// Note that this module must be included after `remark-slug`. | ||
.use(headings) | ||
@@ -73,8 +75,10 @@ .use(html) | ||
### `remark.use(autolinkHeadings[, options])` | ||
### `remark().use(autolinkHeadings[, options])` | ||
Add links to headings. | ||
Automatically add links to headings. | ||
#### `options.behavior` | ||
##### `options` | ||
###### `options.behavior` | ||
How to create links (`string`, default: `'prepend'`). | ||
@@ -87,5 +91,5 @@ Pass `'prepend'` to inject the link before the heading text, `'append'` for a | ||
#### `options.content` | ||
###### `options.content` | ||
[HAST][] nodes to insert in the link (`Node|Children`). | ||
[**hast**][hast] nodes to insert in the link (`Node|Children`). | ||
By default, the following is used: | ||
@@ -101,3 +105,3 @@ | ||
#### `options.linkProperties` | ||
###### `options.linkProperties` | ||
@@ -109,7 +113,9 @@ Extra properties to set on the link (`Object?`). | ||
See [`contributing.md` in `remarkjs/remark`][contributing] for ways to get | ||
started. | ||
See [`contributing.md`][contributing] in [`remarkjs/.github`][health] for ways | ||
to get started. | ||
See [`support.md`][support] for ways to get help. | ||
This organisation has a [Code of Conduct][coc]. By interacting with this | ||
repository, organisation, or community you agree to abide by its terms. | ||
This project has a [Code of Conduct][coc]. | ||
By interacting with this repository, organisation, or community you agree to | ||
abide by its terms. | ||
@@ -122,4 +128,8 @@ ## License | ||
[build-badge]: https://img.shields.io/travis/remarkjs/remark-autolink-headings.svg | ||
[MIT][license] © [Ben Briggs][author] | ||
<!-- Definitions --> | ||
[build-badge]: https://img.shields.io/travis/remarkjs/remark-autolink-headings/master.svg | ||
[build]: https://travis-ci.org/remarkjs/remark-autolink-headings | ||
@@ -135,5 +145,5 @@ | ||
[chat-badge]: https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg | ||
[size-badge]: https://img.shields.io/bundlephobia/minzip/remark-autolink-headings.svg | ||
[chat]: https://spectrum.chat/unified/remark | ||
[size]: https://bundlephobia.com/result?p=remark-autolink-headings | ||
@@ -146,12 +156,20 @@ [sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg | ||
[license]: license | ||
[chat-badge]: https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg | ||
[author]: http://beneb.info | ||
[chat]: https://spectrum.chat/unified/remark | ||
[npm]: https://docs.npmjs.com/cli/install | ||
[contributing]: https://github.com/remarkjs/remark/blob/master/contributing.md | ||
[health]: https://github.com/remarkjs/.github | ||
[coc]: https://github.com/remarkjs/remark/blob/master/code-of-conduct.md | ||
[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 | ||
[author]: http://beneb.info | ||
[remark]: https://github.com/remarkjs/remark | ||
@@ -158,0 +176,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
174
1
13192
16
5
154