Adding support for furigana (e.g. the <ruby>
HTML element) in myst-parser/mystmd's spec
#1004
sugan-reden
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
I would like to investigate the integration of support for the
<ruby>
HTML element that permits the insertion of furigana in markdown content.For full disclosure, I see the MyST project as something that could be used for much more than just the scientific side of docs/papers, and more for general SSG purpose, growing further than Sphinx and potentially rivaling or going beyond Hugo, Docusaurus, Gatsby, Jekyll and the like. That is why I chose it for my projects.
That said, as I was working on said projects, I stumbled against having to raw-dog HTML for the addition of furigana to text.
I would like to know if this would something that could be integrated directly into the syntax?
Example: (taken from the README.md of the iltrof/furigana-markdown-it repo mentioned below)
[漢字]{かんじ}
Or, if
<ruby>
is unsupported:漢字【かんじ】
For reference, I found a few interesting pieces of related work on this here:
iltrof/furigana-markdown-it - An existing markdown-it extension for furigana. In my eyes, this would probably be the most interesting one in this case, because I thought it could be easier to port since MyST was, if I remember correctly, strongly related to markdown-it-py.
djfun/furigana_markdown - Another similar extension, this time in python.
ElnuDev/Foxmark - A markdown renderer capable of handling furigana out-of-the-box, made in python. More recent than the two above.
Note
Something to consider while integrating would be the language variants, as noted in this issue.
Another thing to note while integrating would the stacking/staggering of furigana, and thus
<ruby>
elements, like mentioned in this issue and available in HTML.Related:
@ElnuDev mentioned an exploration of regular expressions for this in their blog. It was originally intended for Hugo use, but they again mention at the end of their conclusion that:
Related to this: https://git.elnu.com/ElnuDev/furigana
Thanks for reading me :)
Beta Was this translation helpful? Give feedback.
All reactions