unified processor with support for parsing and serializing kakuyomu novel format input/output.
This package is a unified processor with support
for parsing and serializing kakuyomu novel format input/output
by using unified with rekurke-parse
and rekurke-stringify
.
- unified is a project that transforms content with abstract syntax trees (ASTs).
- rekurke add support for kakuyomu novel format to unified.
- kkast is the kakuyomu novel AST that rekurke uses.
This package is ESM only. in Node.js (18.0+), Install with npm:
npm install @rshirohara/rekurke
Say we have the following module example.js
:
import { rekurke } from "@rshirohara/rekurke";
main();
async function main() {
const source = [
"これが一段落目。\n",
"これが二段落目。",
"これは|ルビ振《るびふ》り。\r\n\n",
"ここから三段落《さんだんらく》目。",
"これは《《強調》》。",
].join("\n");
const file = await rekurke.process(source);
console.log(String(file));
}
Running that with node example.js
yields:
これが一段落目。
これが二段落目。
これは|ルビ振《るびふ》り。
ここから|三段落《さんだんらく》目。
これは《《強調》》。
Create a new (frozen) unified processor that already uses
rekurke-parse
and rekurke-stringify
.
See unified
for more information.
Kakuyomu novel format is parsed and serialized according to the official article.
The syntax tree format used in rekurke is kkast.
This package is fully typed with TypeScript. There are no extra exported types.