How to output kanji with furiga in the console with Ruby?

Viewed 49

I know that you can add furigana to kanji in html by using the ruby HTML element:

<ruby><rb>令和元年</rb><rp>(</rp><rt>れいわがんねん</rt><rp>)</rp></ruby>

Which looks like:

furigana-output-in-html

I was wondering if I could achieve similar output in the Ruby console?

>> "令和元年 れいわがんねん"
=> "令和元年 れいわがんねん"

Are there any existing gem or built in methods which would bring the furigana above the kanji?

0 Answers
Related