# remark-hatena-id

> Hatena's id notation plugin for Remark

Latest version **1.0.2** (published 2025-05-15) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 40/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2025-05-15 |
| First published | 2023-04-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 14.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | cateiru |
| Maintainers | cateiru |
| Keywords | markdown, hatena, hatenaId, remark, plugin |

## Links

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

## Dependencies (2)

- [unist-builder](https://npm.io/package/unist-builder.md) ^4.0.0
- [unist-util-visit](https://npm.io/package/unist-util-visit.md) ^5.0.0

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 1.0.2 (latest) — 2025-05-15
- 1.0.1 — 2024-08-20
- 1.0.0 — 2023-04-28

## README

# remark-hatena-id

[![npm version](https://badge.fury.io/js/remark-hatena-id.svg)](https://badge.fury.io/js/remark-hatena-id) [![CI](https://github.com/cateiru/remark-hatena-id/actions/workflows/ci.yml/badge.svg)](https://github.com/cateiru/remark-hatena-id/actions/workflows/ci.yml)

This package is a [unified](https://github.com/unifiedjs/unified) ([remark](https://github.com/remarkjs/remark)) plugin to add Hatena's id notation.

## What is id notation?

Hatena's id notation means that if you write something like `id:name`, it becomes a link.

You can also display icons together by describing them as `id:name:detail`.

For more information, see [はてな記法一覧 - はてなブログ ヘルプ](https://help.hatenablog.com/entry/text-hatena-list#%E8%87%AA%E5%8B%95%E3%83%AA%E3%83%B3%E3%82%AF).

## Installation

This package is suitable for ESM only.

```bash
npm i remark-hatena-id
```

```bash
yarn add remark-hatena-id
```

```bash
pnpm i remark-hatena-id
```

## Usage

Describe example.md using the id notation. The following is an example.

```md
# Title

Hello id:hatena !
```

```js
import { read } from "to-vfile";
import remark from "remark";
import gfm from "remark-gfm";
import remarkRehype from "remark-rehype";
import rehypeStringify from "rehype-stringify";
import { remarkHatenaId } from "remark-hatena-id";

main();

async function main() {
  const file = await remark()
    .use(gfm)
    .use(remarkHatenaId)
    .use(remarkRehype)
    .use(rehypeStringify)
    .process(await read("example.md"));

  console.log(String(file));
}
```

Running the script should return the following results.

```html
<h1>Title</h1>
<p>Hello <a href="https://profile.hatena.ne.jp/hatena/" data-hatena-id="hatena">id:hatena</a> !</p>
```

## LICENSE

[MIT](./LICENSE)

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