Class Ruby


@Bean(typeName="ruby") public class Ruby extends HtmlElementMixed
DTO for an HTML <ruby> element.

The ruby element represents a ruby annotation. It is used to provide pronunciation or translation information for text in languages that use complex writing systems, such as Japanese, Chinese, or Korean. The ruby element typically contains rb (ruby base) elements for the base text and rt (ruby text) elements for the annotations. It can also contain rp (ruby parenthesis) elements for fallback display when ruby annotations are not supported. Ruby annotations are commonly used to provide furigana (pronunciation guides) for Japanese text.

Examples:

import static org.apache.juneau.bean.html5.HtmlBuilder.*; // Simple ruby annotation Ruby simple = ruby( rb("漢字"), rt("かんじ") ); // Ruby with styling Ruby styled = ruby( rb("日本語"), rt("にほんご") )._class("ruby-annotation"); // Ruby with complex content Ruby complex = ruby( rb("複雑な漢字"), rt("ふくざつなかんじ"), rp("("), rp(")") ); // Ruby with ID Ruby withId = ruby( rb("漢字"), rt("かんじ") ).id("ruby-annotation-1"); // Ruby with styling Ruby styled2 = ruby( .style("font-size: 1.2em; line-height: 1.5;") .children( new Rb().children("漢字"), new Rt().children("かんじ") ); // Ruby with multiple elements Ruby multiple = new Ruby() .children( new Rb().children("複雑な"), new Rt().children("ふくざつな"), new Rb().children("漢字"), new Rt().children("かんじ") ); // Ruby with links Ruby withLinks = new Ruby() .children( new Rb().children("漢字"), new Rt().children( new A().href("/dictionary/kanji").children("かんじ") ) );

See Also: