DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:xhtmlruby

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Both sides next revision
plugin:xhtmlruby [2010-05-01 10:49]
86.89.151.209
plugin:xhtmlruby [2018-05-31 00:40]
Klap-in
Line 6: Line 6:
 email      : pomax@nihongoresources.com email      : pomax@nihongoresources.com
 type       : Action type       : Action
-lastupdate : 2010-05-01+lastupdate : 2010-10-14
 compatible : 2009-02-14b (not tested on earlier versions) compatible : 2009-02-14b (not tested on earlier versions)
 tags       : ruby, furigana tags       : ruby, furigana
 +
 +downloadurl: http://projects.nihongoresources.com/downloadables/plugin-xhtmlruby.tar.gz
 ---- ----
  
 ===== Download and Installation ===== ===== Download and Installation =====
  
-Download and install the plugin using the [[plugin:plugin|Plugin Manager]] using the following URL. +Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
- +
-  * [[http://pomax.nihongoresources.com/downloads/plugin-xhtmlruby.tar.gz|tar.gz format (3k)]] +
- +
-To install the plugin manually, download the source to your plugin folder, ''lib/plugins'', and extract its contents That will create a new plugin folder, ''lib/plugins/xhtmlruby'', containing four file:+
  
-  * style.css - CSS styling for the ruby markup +  * [[http://projects.nihongoresources.com/downloadables/plugin-xhtmlruby.tar.gz|tar.gz format (3k)]] FIXME Link not available (as at 12-Sep-2013) 
-  * conf.ini an ini file for setting whether to parse wiki text or not, and TOC text or not. +  * [[http://sites.google.com/site/seifer03/index/dokuwiki_xhtmlruby.zip|zip format (3k)]], Temp Mirror :!:
-  * script.js a script that ensures the CSS styling is correct for the browser that's loading the page +
-  * action.php - the plugin+
  
-The plugin is now installed. 
 ===== Important installation note ===== ===== Important installation note =====
  
Line 96: Line 91:
 ===== Bugs ===== ===== Bugs =====
  
-None known at the time of writing.+<del>None known at the time of writing.</del> 
 + 
 +Unfortunately, on my 2017 Frusterick Manners, this plugin causes <code> 
 +ReferenceError: addInitEvent is not defined 
 +addInitEvent(function(){ fixRubyAlignment(); }); 
 +js.php?...3892c5d (line 65824)</code> 
 + 
 +I have changed ''addInitEvent'' on the last line of script.js to ''jQuery'' (per suggestion on [[plugin:cellbg#compatibility_issues]] although I don't know the reason), but then it's found that on Line 29 ''cssRule.selectorText'' is also not defined... 
 + 
 +So finally I decided to: 
 +  - remove script.js in the plugin folder 
 +  - disable the plugin 
 +  - re-enable it again 
 +-> seems no problem so far, the action.php and the CSS file still do their jobs. I know that script.js can deal some compatibility problems across browsers, but I don't have the ability to debug it. --- [[user>MilchFlasche|MilchFlasche]] //2017-11-03 17:11//
 ===== Source ===== ===== Source =====
  
Line 222: Line 230:
  // Opera (9.5x) is even more annoying. Neither "bottom" nor "baseline" does what it's supposed to do, so we're left with value (em) manipulation instead.  // Opera (9.5x) is even more annoying. Neither "bottom" nor "baseline" does what it's supposed to do, so we're left with value (em) manipulation instead.
  else if(browser=="opera") { rubyrule.style.verticalAlign = "1.3em"; }  else if(browser=="opera") { rubyrule.style.verticalAlign = "1.3em"; }
-  +
- // Chrome 4.x doesn't support ruby unless IT gets to call the CSS shots +
- else if(browser=="chrome") { +
- killCSSRule('rp'); +
- killCSSRule('rt'); +
- killCSSRule('rb'); +
- killCSSRule('ruby'); }+
  // if we don't know what browser this is, assume "bottom" works. If it doesn't, their fault.  // if we don't know what browser this is, assume "bottom" works. If it doesn't, their fault.
  else { rubyrule.style.verticalAlign = "bottom"; }  else { rubyrule.style.verticalAlign = "bottom"; }
Line 288: Line 290:
  * Postprocesses the HTML that was built from that, to rubify kanji that have associated furigana.  * Postprocesses the HTML that was built from that, to rubify kanji that have associated furigana.
  */  */
- function register(&$controller) + function register(Doku_Event_Handler $controller) 
  {  {
  // initialise variables  // initialise variables
Line 334: Line 336:
 ?> ?>
 </file> </file>
-===== Discussion ===== 
- 
->Thank you thank you so much for this fantastic plugin! I searched for a DokuWiki "ruby" plugin thinking it would be so obscure a need I'd never find anything, but was delighted to find something that works EXACTLY like I need it to (in Internet Explorer 6.0 no less!). 
-> 
->I do have one question though, and it's regarding support in Chrome and possibly other browsers. These adhere to HTML5 standards for ruby tags, and therefore the ruby texts, as well as chunks of the page, don't display correctly. Would it be very complicated to add a conditional <ruby>Text<rt>テキスト</rt></ruby> HTML5 style tag in the case of browsers that don't support the XHTML standard? Once again, thanks for this awesome plug-in! --- //kououken 2010/02/19 16:08// 
- 
-Actually, the reason it malrenders in Chrome is because for a while now it's been using a version of webkit that messes up ruby code. If there is no stylesheet CSS rule for the ruby element, things looks fine, but if there is, good chance the ruby markup magically disappears (see [[http://pomax.nihongoresources.com/downloads/temp/chrome%20xhtml%20css%20bug/demonstrator.html|here]] for a demonstrator of this behaviour, and [[http://code.google.com/p/chromium/issues/detail?id=27659|here]] for the bugfix in webkit). This has been filed as bug for webkit, and has been patched, but Chrome has to date (being at public version 4.1.249.1064) not updated to include this webkit patch. 
- 
-I've updated the javascript responsible for massaging the CSS based on browsers, so that it actually dynamically removes all css ruby rule when it sees Chrome is being used. This seems to be the only working fix at the moment (hopefully the damn Chrome team reads my @#%! bug reports. The webkit people responded immediately, and fixed the issue in a few hours, the Chrome team hasn't reacted even once yet to my weeks and weeks of filing bug reports). --- //Pomax 2010/05/01 00:15// 
plugin/xhtmlruby.txt · Last modified: 2018-05-31 00:40 by Klap-in