HTML Ruby
Sunday, April 25, 2010 12:00:00 AM
This script adds support for ruby annotation in Opera. (What about Firefox?)What is ruby?
Ruby, here, is not the programming language Ruby but the ruby annotation used in web pages. These "ruby" are small texts that are usually displayed above base texts to show the pronunciation of characters used in East Asian languages.
What is the problem?
Ruby annotation itself is currently a W3C recommendation as a XHTML 1.1 module with a supporting CSS3 module for styling. However, the only browser to have any kind of built-in support is Internet Explorer which implemented the draft specification in IE 5 and Chrome 4 which now has rudimentary support for rendering the HTML5 draft spec ruby annotation.
Pure CSS solutions are possible in Opera with User Stylesheet (see download section), but they do not provide text spacing and will break when faced with unclosed ruby tags.
How does HTML Ruby solve it?
As mentioned above, this script adds support for rendering of ruby annotation in Opera. The script almost supports the full specification described in this draft for HTML ruby annotation and this W3C recommendation for XHTML ruby annotation and includes support for complete baseline alignment, the rbspan attribute, rb/rt text spacing, and unclosed ruby tags.
Try it for yourself at W3C's I18N Tests: Ruby markup and many other sites that use ruby annotation.
Download
HTML Ruby 6 and optional settings file for Opera 10.5 (at userscripts.org)
Change Log
CSS used in HTML Ruby can be used on its own as a User Stylesheet
Known Issues
If you experience messed-up encoding while using this script, refreshing the page or setting the encoding manually should solve the problem. This may occur when encountering unclosed ruby tags on a non-unicode page where there is no server-supplied encoding.
エンコードがサーバから指定されていないページで、タグが閉じられていないルビがあった場合、ページが文字化けする可能性があります。文字化けした場合、ページをリロードするか手動で適切なエンコードを指定することで正常に表示されます。
Special Thanks
Ti, White Lynx, and xErath who helped me develop HTML Ruby and provided me with valuable feedback.


metude # Sunday, April 4, 2010 9:11:21 AM
kailapis # Sunday, April 25, 2010 1:53:17 AM
metude # Sunday, April 25, 2010 7:51:39 AM
Please write comment when you publish an update...
kailapis # Sunday, April 25, 2010 3:37:37 PM
* Cleaning up the code a bit
I might just use the comments as a change log.
@metude: yeah... I would like a better notification system though. Would be nice if Opera had an official site like they do with widgets.
kailapis # Friday, June 18, 2010 3:05:30 AM
* added conditional for better cleaning of unclosed tags
metude # Friday, June 18, 2010 9:32:25 AM
JerryJerryLoo555 # Saturday, September 25, 2010 11:53:18 AM
Anonymous # Monday, October 4, 2010 9:37:04 PM
kailapis # Tuesday, November 16, 2010 2:31:34 AM
* updated code to get rid of JS error when there's no settings file
kailapis # Tuesday, November 16, 2010 2:34:59 AM
Originally posted by anonymous:
Yes... Opera hasn't done much in terms of helping users use UserJS.
See http://operawiki.info/UserJS#howto
jesus2099 # Tuesday, November 16, 2010 9:01:23 AM
Thanks for your last HTMLRubySettings "undefined" fix :)
That's very kind of you citing me in your awesome script's page!
Don't you think it could be nice having the configuration at the beginning of the script, this way having just one .js file?
--
jesus2099 × Ti = Tristan + patate12 ÷ saucisson7
kailapis # Wednesday, November 17, 2010 2:33:19 AM
Originally posted by Ti:
Yeah, my rationale was that having the settings file separately would allow users to just save over the existing file.
Anyway, I'm making an Opera extension of HTML Ruby, since Opera seems to be moving in that direction... (years of neglecting UserJS and now having an official repo for extensions). I just need to find an easy way to offer an "options" page without creating a button in the address bar...
http://htmlrubyopera.codeplex.com/
jesus2099 # Wednesday, November 17, 2010 9:29:56 AM
http://labs.opera.com
These extensions will be great thanks to yours to begin with.
Anonymous # Thursday, September 1, 2011 10:01:22 AM
Anonymous # Friday, September 2, 2011 3:37:02 PM
Anonymous # Saturday, September 3, 2011 3:27:47 AM