unified processor with support for parsing and serializing pixiv novel format input/output.
This package is a unified processor with support
for parsing and serializing pixiv novel format input/output
by using unified with repixe-parse
and repixe-stringify
.
- unified is a project that transforms content with abstract syntax trees (ASTs).
- repixe adds support for pixiv novel format to unified.
- pxast is the pixiv novel AST that repixe uses.
This package is ESM only. in Node.js (18.0+), Install with npm:
npm install @rshirohara/repixe
Say we have the following module example.js
:
import { repixe } from "@rshirohara/repixe";
main();
async function main() {
const source = [
"これが一段落目\n\n",
"ここから二段落目",
"[[rb:二行目>にぎょうめ]]",
"[[jumpuri:リンク>https://example.com]]も使える。"
].join("\n");
const file = await repixe().process(source);
console.log(String(file));
}
Running that with node example.js
yields:
これが一段落目
ここから二段落目
[[rb: 二行目 > にぎょうめ]]
[[jumpuri: リンク > https://example.com]]も使える。
Create a new (unfrozen) unified processor that already uses
repixe-parse
and repixe-stringify
.
See unified
for more information.
Pixiv novel format is parsed and serialized according
to official article
and pixiv-novel-parser
.
The syntax tree format used in repixe is pxast.
This package is fully typed with TypeScript. There are no extra exported types.