# @rshirohara/repixe-parse

> repixe plugin to add support for parsing pixiv novel format.

Latest version **0.3.2** (published 2025-01-20) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @rshirohara/repixe-parse
pnpm add @rshirohara/repixe-parse
yarn add @rshirohara/repixe-parse
bun add @rshirohara/repixe-parse
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.3.2 |
| Published | 2025-01-20 |
| First published | 2023-06-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 2 |
| Unpacked size | 241 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 0 |
| Author | Ray Shirohara |
| Maintainers | rshirohara |
| Keywords | unified, repixe, pixiv |

## Links

- npm: https://www.npmjs.com/package/@rshirohara/repixe-parse
- Repository: https://github.com/RShirohara/unified-webnovel
- Homepage: https://github.com/RShirohara/unified-webnovel/tree/main/packages/repixe-parse#readme
- Issues: https://github.com/RShirohara/unified-webnovel/issues
- npm.io page: https://npm.io/package/@rshirohara/repixe-parse

## Dependencies (2)

- [unified](https://npm.io/package/unified.md) ^11.0.5
- [@rshirohara/pxast](https://npm.io/package/@rshirohara/pxast.md) ^0.3.1

## Recent versions

- 0.3.2 (latest) — 2025-01-20
- 0.3.1 — 2024-12-01
- 0.3.0 — 2024-10-27
- 0.2.4 — 2024-09-08
- 0.2.3 — 2024-04-14
- 0.2.2 — 2024-04-09
- 0.2.1 — 2024-02-25
- 0.1.5 — 2023-08-06
- 0.1.4 — 2023-08-06
- 0.1.3 — 2023-07-31
- 0.1.2 — 2023-07-31
- 0.1.1 — 2023-06-20
- 0.1.0 — 2023-06-12

## README

# repixe-parse

[![LICENSE][license-badge]][license]

**repixe** plugin to add support for parsing [pixiv novel][pixiv-novel] format.

## Contents

- [repixe-parse](#repixe-parse)
  - [Contents](#contents)
  - [What is this?](#what-is-this)
  - [Install](#install)
  - [Use](#use)
  - [API](#api)
    - [`unified().use(repixeParse)`](#unifieduserepixeparse)
  - [Syntax](#syntax)
  - [Syntax tree](#syntax-tree)
  - [Types](#types)
  - [License](#license)

## What is this?

This package is a [unified][] plugin that defines how to take [pixiv novel][pixiv-novel] format
as input and turn it into a syntax tree.

## Install

This package is [ESM only](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c).
in Node.js (18.0+), Install with [npm][]:

```shell
npm install @rshirohara/repixe-parse
```

## Use

Say we have the following module `example.js`:

```js
import { unified } from "unified";
import { repixeParse } from "@rshirohara/repixe-parse";

main();

async function main() {
  const source = [
    "これが一段落目\n\n",
    "ここから二段落目",
    "[[rb:二行目>にぎょうめ]]",
    "[[jumpuri:リンク>https://example.com]]も使える。"
  ].join("\n");
  const ast = await unified().use(repixeParse).parse(source);

  console.log(ast);
}
```

Running that with `node example.js` yields:

```js
{
  type: "root",
  children: [
    {
      type: "paragraph",
      children: [
        {type: "text", value: "これが一段落目"}
      ]
    },
    {
      type: "paragraph",
      children: [
        {type: "text", value: "ここから二段落目"},
        {type: "break"},
        {type: "ruby", value: "二行目", ruby: "にぎょうめ"},
        {type: "break"},
        {type: "link", url: "https://example.com", children: [
          {type: "text", value: "リンク"}
        ]},
        {type: "text": value: "も使える"}
      ]
    }
  ]
}
```

## API

### `unified().use(repixeParse)`

Add support for parsing pixiv novel format input.
There are no options.

## Syntax

Pixiv novel format text is parsed according to the [official documentation][pixiv-novel-notation].

## Syntax tree

The syntax tree format used in repixe is [pxast][].

## Types

This package is fully typed with [TypeScript][].
There are no extra exported types.

## License

[MIT][license]

<!-- Link Definitions -->

[license-badge]: https://img.shields.io/github/license/RShirohara/unified-webnovel
[license]: ./LICENSE.md
[npm]: https://docs.npmjs.com/cli/install
[pixiv-novel-notation]: https://www.pixiv.help/hc/ja/articles/235584168-%E5%B0%8F%E8%AA%AC%E4%BD%9C%E5%93%81%E3%81%AE%E6%9C%AC%E6%96%87%E5%86%85%E3%81%AB%E4%BD%BF%E3%81%88%E3%82%8B%E7%89%B9%E6%AE%8A%E3%82%BF%E3%82%B0%E3%81%A8%E3%81%AF
[pixiv-novel]: https://www.pixiv.net/novel
[pxast]: ../pxast
[typescript]: https://www.typescriptlang.org
[unified]: https://github.com/unifiedjs/unified

---
_Source: https://npm.io/package/@rshirohara/repixe-parse · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
