# remark-heading-id

> The remark plugin for supporting custom heading id also including default id

Latest version **1.0.1** (published 2023-08-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install remark-heading-id
pnpm add remark-heading-id
yarn add remark-heading-id
bun add remark-heading-id
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2023-08-22 |
| First published | 2019-02-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/remark-heading-id) |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 2 |
| Unpacked size | 10.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 45 |
| Author | imcuttle |
| Maintainers | moyuyc, spikeon |
| Keywords | imcuttle, remark, heading, id, remark-heading-id, custom |

## Links

- npm: https://www.npmjs.com/package/remark-heading-id
- Repository: https://github.com/imcuttle/remark-heading-id
- Homepage: https://github.com/imcuttle/remark-heading-id#readme
- Issues: https://github.com/imcuttle/remark-heading-id/issues
- npm.io page: https://npm.io/package/remark-heading-id

## Dependencies (2)

- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [unist-util-visit](https://npm.io/package/unist-util-visit.md) ^1.4.0

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2023-08-22
- 1.0.0 — 2019-02-27

## README

# remark-heading-id

[![Build status](https://img.shields.io/travis/imcuttle/remark-heading-id/master.svg?style=flat-square)](https://travis-ci.org/imcuttle/remark-heading-id)
[![Test coverage](https://img.shields.io/codecov/c/github/imcuttle/remark-heading-id.svg?style=flat-square)](https://codecov.io/github/imcuttle/remark-heading-id?branch=master)
[![NPM version](https://img.shields.io/npm/v/remark-heading-id.svg?style=flat-square)](https://www.npmjs.com/package/remark-heading-id)
[![NPM Downloads](https://img.shields.io/npm/dm/remark-heading-id.svg?style=flat-square&maxAge=43200)](https://www.npmjs.com/package/remark-heading-id)
[![Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://prettier.io/)
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg?style=flat-square)](https://conventionalcommits.org)

> The remark plugin for supporting [custom heading id](https://www.markdownguide.org/extended-syntax/#heading-ids) and Default Id

### Custom Heading Input

```markdown
### My Great Heading {#custom-id}
```

### Custom Heading Output

```html
<h3 id="custom-id">My Great Heading</h3>
```

### API

This package exports no identifiers. The default export is `remarkHeaderId`.

`unified().use(remarkHeadingId[, options])`

#### options

Configuration (optional).

#### options.defaults

Whether to add default titles based on the title text (boolean, default: false).

##### Default Heading Input

```markdown
### My Great Heading
```

##### Default Heading Output

```html
<h3 id="my-great-heading">My Great Heading</h3>
```

## Contributing

- Fork it!
- Create your new branch:  
  `git checkout -b feature-new` or `git checkout -b fix-which-bug`
- Start your magic work now
- Make sure npm test passes
- Commit your changes:  
  `git commit -am 'feat: some description (close #123)'` or `git commit -am 'fix: some description (fix #123)'`
- Push to the branch: `git push`
- Submit a pull request :)

## Authors

This library is written and maintained by imcuttle, <a href="mailto:moyuyc95@gmail.com">moyuyc95@gmail.com</a>.

## License

MIT - [imcuttle](https://github.com/imcuttle) 🐟

---
_Source: https://npm.io/package/remark-heading-id · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
