User:Eirikr/Template Tests/ruby

From Wiktionary, the free dictionary
Jump to navigation Jump to search

{{{1}}} {{{2}}}


Description[edit]

This is a template for adding ruby text to a word or phrase. See w:Ruby characters for more information on what ruby text is.

Note that this is only for text layout -- this does not do anything to link text, or to deal with different languages or scripts. It will accept wikitext, so make sure to specify any such linking or languages in the input arguments.

Usage[edit]

This template takes three arguments:

  • {{{1}}}: required: The base text to add a ruby to. Equivalent to the <rb> element that is described in the HTML 5 specification, but that does not currently work in Firefox (as of version 11.0).
  • {{{2}}}: required: The ruby text to add. Equivalent to the <rt> element that is described in the HTML 5 specification, but that does not currently work in Firefox (as of version 11.0).
  • {{{pos}}}: optional: The position of the ruby text. If omitted, defaults to placing the ruby over the base text. Possible values:
    • over
    • under
Ruby text generally goes over the base text. This parameter is intended for cases where the ruby might want to go beneath, and for future extensibility if and when browser technology is capable of handling rubies to the left or right of the base text, such as to the right in common top-to-bottom text layouts for Chinese and Japanese (and to a lesser extent for Korean).

Examples[edit]

To add the ruby above the base text:

{{ruby|qui dolorem ipsum quia [[dolor#Latin|dolor]] sit amet,|
 who loves or pursues or desires to obtain pain of itself, because it is [[pain]],}}

Sample in running text:

Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet,who loves or pursues or desires to obtain pain of itself, because it is pain, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur?

To add the ruby below the base text:

{{ruby|pos=under|qui dolorem ipsum quia [[dolor#Latin|dolor]] sit amet,|
 who loves or pursues or desires to obtain pain of itself, because it is [[pain]],}}

Sample in running text:

Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet,who loves or pursues or desires to obtain pain of itself, because it is pain, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur?

Japanese furigana example:

{{ruby|{{l|ja|管轄}}|かんかつ}}する

Rendering:

管轄。 かんかつ。する

かんかつ
管轄
。する

experimenting experimenting.
ガブガブガブガブガブガブガブガブ
.

ガブガブガブガブガブガブガブガブ
experimenting experimenting.
.

Limitations[edit]

  • Justified alignment:
    Due to incomplete support of w:CSS3, it is not currently possible to justify the ruby text using the kashida option that stretches the text to fit the full width of the bounding box, as can be seen in Japanese publications. This can lead to some visual uncertainty when using a short ruby text with a long base text.
  • Vertical ruby text:
    Vertical text in general is not yet supported by the major browsers.