markdown-ruby
v0.0.2
Published
扩展markd的注音符号预览
Downloads
4
Readme
markdown-ruby
项目介绍
本项目库基于furigana-markdown修改而来! 目标是为Markdown文档预览时可以体现注音符号。
Markdown注音符号格式展示说明
Basic Furigana
By default, the following formats can be used.
[世界]^(せかい)
[世界]{せかい}
produces
Inline/Auto-matching Furigana
By default, inline matching can also be used. It only works above kanji however.
世界【せかい】
世界{せかい}
produces
Seperate Furigana for each Kanji
By default, furigana is displayed equally spaced above each kanji. Using any of the seperators . . 。 ・
, spacing can be specified (only in the inline format).
小夜時雨【さ・よ・しぐれ】
produces
Pattern Matching Furigana
Pattern matching, enabled by default, also allows the following formats, in which the whole word can be added in kana to the furigana.
食べる【たべる】
食べる{たべる}
produces
By using the basic furigana format, compound words can be matched too.
[取り返す]{とりかえす}
produces
This makes it easier to get the kanji version of the word from an IME without backtracking through the text to place furigana.
安装
npm install
使用
import MDRubyRender from 'markdown-ruby'
marked
var renderer = new marked.Renderer()
MDRubyRender.registerMarked(renderer);