[Resurrection!] Suggested forum feature: ruby text

TEST, ignore me

<ruby>
<rb>東京</rb><rp>(</rp><rt>とうきょう</rt><rp>)</rp>
</ruby>
東京(とうきょう)

(test)

Threw together a WaniKani Rubyizer. Will only Rubyize for those cool enough to use scripts, but hey, better than nothing right?
Any testers?

https://greasyfork.org/en/scripts/31342-wanikani-rubyizer

4 Likes

Awesome! Do you need to write it like you did or are there any shortcuts?

Just gotta put everything inside the “preformatted text”. But did find issue. It’ll likely kill all other formatting. Trying to tweak it atm.

No simple (kanji)[furigana] type stuff then? I guess using tags aren’t too bad, it’s definitely better than nothing!

And slightly improved. Should hopefully not kill all formatting now.

I was thinking too literal… Suppose we could add support for (kanji)[furigana] or something similar. Wanted to use span attributes, to hide furigana for those without rubyizer, but Discourse strips it before its posted.

1 Like

It’s a nice idea - and I appreciate your gumption - but default posts will look ridiculous with code blocks all over them for anyone viewing the forum without the script :upside_down_face:

Like if someone mentioned <ruby> <rb>東京</rb><rp>(</rp><rt>とうきょう</rt><rp>)</rp> </ruby> and <ruby> <rb>大阪</rb><rp>(</rp><rt>おおさか</rt><rp>)</rp> </ruby> and ```

福岡(ふくおか)


I think we'll have to let this one lie until/if commonmark (markdown parser discourse uses) implements ruby tags. Make some noise here perhaps https://talk.commonmark.org/t/proper-ruby-text-rb-syntax-support-in-markdown/2279
2 Likes
<ruby><rb>東京</rb><rp>(</rp><rt>とうきょう</rt><rp>)</rp></ruby>

TEST

Hmm, true. Let me rethink this…

[東京](とうきょう)
[振り仮名](ふりがな)

TEST

Alright, so I think I’ve found a decent compromise.

Inside a code block, put kanji in brackets, and furigana in parenthesis. Thought about just making a format rule not requiring the code blocks, but its easier to only scan code blocks and do replacements, than to scan everything. Likely end up doing accidental replacing that way.
Having random small code blocks in the middle of sentences looks a little funny, but not terrible. Still totally readable to those without the script, just make them slightly puzzled.
yeah, turning out to be a nightmare :confounded: and here I thought this wouldn’t be hard

I just posted requests for support for ruby tags on meta.discourse.org [here] and talk.commonmark.org [here].

4 Likes

I registered on Discourse meta and Common Mark to like your posts. I’m sure that will make all the difference.

2 Likes

Whaaat? Plans don’t normally offer plugin support? That’s a bit messed up!

Seeing as it’s nothing huge, and WaniKani isn’t an “enterprise”-scale site… do you think asking could be worth it? Contacting Discourse and asking if they could add this small plugin (seeing as it’s fairly integral to Japanese, the site’s subject matter, after all) might just work. It would also be much (much) faster than waiting for inclusion in CommonMark. Plus, I doubt CommonMark’s spec would include as many features as @xv435’s work. In particular, I can imagine them having issues with the bracket-less (何【なに】) syntax, and there’s pretty much no way they’ll include the hiragana matching stuff (which I’m not sure is a good idea anyway, but hey).

How about it? I don’t know how strict Discourse are with their pricing tiers, but I hear they’re fairly nice people.

@obskyr,

I posted on the Discourse dev forum and on CommonMark.org. Sam from Discourse is already asking Jeff Atwood how he prefers to implement it. Sam is probably the one who will whitelist <ruby> in Discourse, and Jeff is one of the Discourse co-founders, and is involved in CommonMark development.

If we want to see specific features implemented in CommonMark, now is the time to post them. There’s already a <ruby> thread [here] where some options have been listed.

1 Like

Not too surprising actually, especially because WK is not an “enterprise-scale” site. I’m guessing WK is on the “Business” plan ($200/mo), which is definitely not enough money per month to warrant support for custom plugins.

Yup, I’ve gone ahead and replied! I hope it turns out well. I really hope they make sure any implementation will satisfy people who write a lot in Japanese. :cold_sweat:

Why would it cost money to install plugins, though?

It never dawned on me before, but ruby text is also somewhat usable for translation:

3 Likes

Installation is the cheap part; it doesn’t cost anything more than the time it costs to install the plugin (and possibly validate it). From Discourse’s business perspective however, it adds a lot of extra complexity to each installation, which increases support costs.