Furigana/Ruby BBCode Implementation

Got a complaint or a suggestion? Also used for general information about the site.
Post Reply
User avatar
WhiteShark
Turtle
Turtle
Posts: 2376
Joined: Feb 2, '23

Furigana/Ruby BBCode Implementation

Post by WhiteShark »

Furigana and ruby are the Japanese terms for annotations placed above words in a text to show their reading. I think it would be a neat feature for the HQ. While investigating whether it was already a feature of phpBB, I stumbled upon this post suggesting the details of a BBCode implementation. @rusty_shackleford, does it seem doable?
User avatar
Nooneatall
Posts: 682
Joined: Dec 4, '23
Location: The Congo
Gender: Watermelon

Post by Nooneatall »

I've noticed people can't pronounce words anymore so this is probably needed unfortunately.
User avatar
rusty_shackleford
Site Admin
Posts: 11483
Joined: Feb 2, '23
Gender: Watermelon
Contact:

Post by rusty_shackleford »

Quick question before I investigate further: Isn't this something that can be accomplished using unicode?
[edit]
chatgpt says no
Last edited by rusty_shackleford on April 19th, 2024, 01:39, edited 1 time in total.
User avatar
rusty_shackleford
Site Admin
Posts: 11483
Joined: Feb 2, '23
Gender: Watermelon
Contact:

Post by rusty_shackleford »

@WhiteShark What do you think about:
[ruby={TEXT1}]{TEXT2}[/ruby]
which maps to:
<ruby>{TEXT1} <rt>{TEXT2}</rt></ruby>

?
I've never used the <ruby> element so I have no idea if this is enough to get what you want.
User avatar
WhiteShark
Turtle
Turtle
Posts: 2376
Joined: Feb 2, '23

Post by WhiteShark »

@rusty_shackleford, I think it were more intuitive to swap TEXT1 and TEXT2. To me it makes more sense to have the ruby=ANNOTATION correspond to the annotation that appears above, and the text in between the tags correspond to the normal text. I messed around in an html file to test <ruby> and <rt> and I think that mapping looks fine otherwise.
User avatar
rusty_shackleford
Site Admin
Posts: 11483
Joined: Feb 2, '23
Gender: Watermelon
Contact:

Post by rusty_shackleford »

WhiteShark wrote: April 19th, 2024, 11:18
@rusty_shackleford, I think it were more intuitive to swap TEXT1 and TEXT2. To me it makes more sense to have the ruby=ANNOTATION correspond to the annotation that appears above, and the text in between the tags correspond to the normal text. I messed around in an html file to test <ruby> and <rt> and I think that mapping looks fine otherwise.
test above

Does this work for you?
What above the words above(<rt> part), do I need to make that bigger?
User avatar
WhiteShark
Turtle
Turtle
Posts: 2376
Joined: Feb 2, '23

Post by WhiteShark »

@rusty_shackleford, it works.

金峰山 キンポウザン

I think the proportion is right. It's very small, but that's a function of the default text size being very small. I use the HQ zoomed in a bit anyway, so it doesn't bother me.
User avatar
rusty_shackleford
Site Admin
Posts: 11483
Joined: Feb 2, '23
Gender: Watermelon
Contact:

Post by rusty_shackleford »

WhiteShark wrote: April 19th, 2024, 11:38
@rusty_shackleford, it works.

金峰山 キンポウザン

I think the proportion is right. It's very small, but that's a function of the default text size being very small. I use the HQ zoomed in a bit anyway, so it doesn't bother me.
I'm glad I could help you write boxes above boxes :heart:
User avatar
rusty_shackleford
Site Admin
Posts: 11483
Joined: Feb 2, '23
Gender: Watermelon
Contact:

Post by rusty_shackleford »

I sure hope this addition won't be abused for nefarious purposes It's going to be abused so hard..
User avatar
WhiteShark
Turtle
Turtle
Posts: 2376
Joined: Feb 2, '23

Post by WhiteShark »

rusty_shackleford wrote: April 19th, 2024, 11:40
I sure hope this addition won't will be abused for nefarious purposes.
Do you agree with me about the mapping of TEXT1 and TEXT2? I'm having second thoughts. It makes more sense to me the way I suggested when looking at it after the fact, but when in the process of writing, the original ordering may be better because it puts the main text first.
User avatar
rusty_shackleford
Site Admin
Posts: 11483
Joined: Feb 2, '23
Gender: Watermelon
Contact:

Post by rusty_shackleford »

WhiteShark wrote: April 19th, 2024, 11:44
rusty_shackleford wrote: April 19th, 2024, 11:40
I sure hope this addition won't will be abused for nefarious purposes.
Do you agree with me about the mapping of TEXT1 and TEXT2? I'm having second thoughts. It makes more sense to me the way I suggested when looking at it after the fact, but when in the process of writing, the original ordering may be better because it puts the main text first.
I write the text first, select it, then press the button to wrap it in the bbcode. So, it seems fine to me.
Post Reply