You could use it for pinyin annotations too, or really any combination of scripts.

睾丸 こ がんぶたくそ

猪蛋蛋上的粪便 Zhū dàn dàn shàng de fèn biàn

фекалииfekalii наna свиныхsvinykh яйцах yaytsakh

People were just talking about this in a thread earlier but I can’t find it anymore. Figured this would be a good place for it.

Check out the source code of this post. It actually looks for space characters after the pipe symbol and uses that to group the furigana. It’s actually easiest to use for Chinese, Japanese is a bit more work, and alphabetical scripts are pretty time consuming, because you have to mark up each word with brackets and pipes, spaces don’t cut it.

  • AernaLingus [any]@hexbear.net
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    24 days ago

    Ooh, I knew about the basic syntax but I didn’t know about the spaces thing! Should definitely same some time and hassle. Also makes copy-pasting the text much nicer, since the ruby text goes after each bracket grouping which is pretty terrible if you’ve marked up each individual character.

    The one potential downside is that this approach doesn’t add additional space between each group if the ruby text is long and spills over to neighboring groups. Compare these two results, where the top uses the spaces approach and the bottom individually marks each word/particle:

    猪蛋蛋上的粪便 Zhū dàn dàn shàng de fèn biàn

    Zhū蛋蛋dàndànshàngde粪便fènbiàn

    You can see that some extra space is left around 上 so that shàng can remain centered over it. However, there’s a separate downside to this: it appears that while it will prevent ruby text from outright overlapping, it doesn’t actually try to insert any space between adjacent groupings. So if I use the same pinyin style as your original post, the result around dàn dàn is not great:

    Zhū蛋蛋dàn dànshàngde粪便fèn biàn

    You can combat this by adding trailing spaces as needed, but it will look a bit haphazard because the space is included in the width when centering the ruby text, making everything look shifted to the left (here I put spaces after Zhū and dàn dàn):

    Zhū 蛋蛋dàn dàn shàngde粪便fèn biàn

    Unless the text is so long that it becomes difficult to understand which reading goes with which character(s), it’s more of an aesthetic choice than anything; personally I like having the extra space, but I could see some not liking the irregularity. Probably less of an issue for Chinese than it is for Japanese where furigana can be much longer than the word, especially with some kun’yomi or wonky stuff used in fiction.

    • SerLava [he/him]@hexbear.netOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      edit-2
      19 days ago

      hexbear was built off code similar to lemmy, and then we semi-merged with the actual site, implementing the proper lemmy base code plus more neatly separated code for the custom functionality here. This allowed cross posting,