Skip to content

A markdown-it plugin to support Aozora Bunko style ruby syntax.

License

Notifications You must be signed in to change notification settings

aiwas/markdown-it-aozora-ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

markdown-it-aozora-ruby

JSR

A markdown-it plugin to support Aozora Bunko style ruby syntax.

Features

  • Parses Aozora Bunko style ruby like below:
    • 耳まで火照《ほて》って
    • 武州|青梅《おうめ》の宿

Installation

deno add jsr:@aiwas/markdown-it-aozora-ruby

Usage

import MarkdownIt from "markdown-it";
import aozoraRubyPlugin from "@aiwas/markdown-it-aozora-ruby";

const md = new MarkdownIt().use(aozoraRubyPlugin);

const html = md.render(
  "これは青空文庫《あおぞらぶんこ》のルビ記法を使用するためのプラグインです。",
);

console.log(html);

Output:

<p>これは<ruby>青空文庫<rp></rp><rt>あおぞらぶんこ</rt><rp></rp></ruby>のルビ記法を使用するためのプラグインです。</p>

Disclaimer

Currently, this plugin does NOT strictly support Aozora Bunko notation.
Aozora Bunko displays ruby characters for alphabets separated by spaces, but in this plugin, characters other than kanji must always be separated by the "|" symbol.
For example, no ruby will be rendered for この Markdown《マークダウン》 形式は便利だ。 (that has space before an alphabet word and after the '》' symbol, Aozora Bunko's intended format).

References

About

A markdown-it plugin to support Aozora Bunko style ruby syntax.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published