rubyAnnotation()

`{漢字|かんじ}` 문법을 사용한 루비/후리가나 주석을 지원합니다.

import { rubyAnnotation } from "@unifast/node";

시그니처

function rubyAnnotation(): UnifastPlugin

매개변수

없음.

사용법

import { compile, rubyAnnotation } from "@unifast/node";

const md = `
{漢字|かんじ}の読み方を学びましょう。
`;

const result = compile(md, { plugins: [rubyAnnotation()] });
// {漢字|かんじ}가 <ruby>漢字<rp>(</rp><rt>かんじ</rt><rp>)</rp></ruby>로 변환됩니다

예시

루비 주석 (후리가나)

한 문장에 여러 주석

import { compile, rubyAnnotation } from "@unifast/node";

const md = `
{東京|とうきょう}は{日本|にほん}の{首都|しゅと}です。
`;

const result = compile(md, { plugins: [rubyAnnotation()] });

혼합 콘텐츠

import { compile, rubyAnnotation } from "@unifast/node";

const md = `
# {日本語|にほんご}ガイド

{漢字|かんじ}には**たくさん**の{読|よ}み{方|かた}があります。

- {音読|おんよ}み — Chinese-derived reading
- {訓読|くんよ}み — Native Japanese reading
`;

const result = compile(md, { plugins: [rubyAnnotation()] });