A ruby is a content pair - a main content portion along with content that serves
as a helper or caption to the main content (Ruby Text - RT.) The helper/caption
content usually serves as a pronunciation aid, but can serve other purposes as
well. While the need for this is minimal in western languages, the concept is
best illustrated with a far eastern language like Japanese.
With a character set as complex as Chinese or Japanese, some characters are used
rarely and are thus not as easily recognizable by younger children or possibly
many adults. In Japanese writing, the phonetic Hiragana alphabet is used to
pair phonetic 'helper' readings (called Furigana or Yomigana in Japanese) with
the chinese character counterpart.
A Ruby element contains one or more content/Ruby Text pairs. Each content section
is followed by its optional Ruby Text (RT) element (end tag is optional.) When
rendered, Ruby Text content is always located above the Ruby content unless
directed otherwise by appropriate CSS properties.
DTD Note: I chose to use only 'in-line content' as the
content model - while Block structures can exist within a Ruby element, some
interesting behaviors are apparent. Images render fine also, but not form
widgets.
Browser Peculiarities
Internet Explorer 5.0 Beta 2: An extra element called
a Ruby Base 'RB' existed in this version. This was a container element
which explicitly wrapped the main Ruby content. The syntax was dropped for
the final version of Internet Explorer 5.0. Nothing negative should happen
if this element already exists in documents.
If RT content exists before the RUBY content, the RT content is rendered
small, but inline before the RUBY content.