jgm/djot

Syntax for ruby (<ruby>)

wisim3000 opened this issue · 1 comments

Hi, is it possible to support ruby in djot?

Which is like:

振り仮名ふりがな

Html:

<ruby>振り仮名<rt>ふりがな</rt></ruby>

In Japanese it seems common to display pronunciation with ruby (furigana), especially in light novels.

Also, in Chinese it has some usages on education.

But it should be rare in other languages.

So, should it be considered as a extension?

And I considered something like:

{# 振り仮名 | ふりがな} `

Or:

{#fg 振り仮名 | ふりがな}

`

bpj commented

Without speculating on how likely it is that there will be a dedicated syntax for ruby, while there isn't you could use something with classes and then use a filter to convert it into the right HTML; either nested spans

[😁[grin]{.rt}]{.rb}

or a verbatim and parse it with a regex:

`😁|grin`{.rb}

(A regex like ^([^|]+)\|(.+)$)