<ruby>
explorations
The <ruby>
HTML element represents small annotations that are rendered above, below, or next to
base text, usually used for showing the pronunciation of East Asian characters. It can also be used for annotating
other kinds of text, but this usage is less common.
For example:
明日<ruby>
明日 <rp>(</rp><rt>Ashita</rt><rp>)</rp>
</ruby>
漢
字
<ruby>
漢 <rp>(</rp><rt>Kan</rt><rp>)</rp> 字 <rp>(</rp><rt>ji</rt><rp>)</rp>
</ruby>
Now I was curious as to whether you could stack <ruby>
elements:
A
We can use tracery, which does a random expansion expansion of formal grammars.
The following cell renders a simple grammar. Each part of the tree is either:
- A "terminal", in this case the letter "a"
- A terminal, extended by a "non-terminal"
- A terminal, and then a branch of 2 non-terminals
In this one I make a distinction beteween "branch" terminals and "leaf" terminals.
The following has explicit "left recursion", always attempting to branch and extend on the left and leaving terminals on the right.
Built with @celine/celine v6.0.0