<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mywikibiz.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ARuby-zh</id>
	<title>Module:Ruby-zh - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mywikibiz.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ARuby-zh"/>
	<link rel="alternate" type="text/html" href="https://mywikibiz.com/index.php?title=Module:Ruby-zh&amp;action=history"/>
	<updated>2026-06-22T12:35:01Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.3</generator>
	<entry>
		<id>https://mywikibiz.com/index.php?title=Module:Ruby-zh&amp;diff=479362&amp;oldid=prev</id>
		<title>Zoran: Pywikibot 6.4.0</title>
		<link rel="alternate" type="text/html" href="https://mywikibiz.com/index.php?title=Module:Ruby-zh&amp;diff=479362&amp;oldid=prev"/>
		<updated>2021-07-16T05:50:11Z</updated>

		<summary type="html">&lt;p&gt;Pywikibot 6.4.0&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- Template for generating Ruby for Chinese characters.&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- Annotate a single character with bopomofo.&lt;br /&gt;
-- This can be done in a template... but something else can't.&lt;br /&gt;
function p._zhuyin1(char, bopo, tone)	-- inline-table&lt;br /&gt;
	local ru = mw.html.create('span')&lt;br /&gt;
	ru&lt;br /&gt;
		:addClass('zhuyin-ru')&lt;br /&gt;
		:wikitext(char)&lt;br /&gt;
		:tag('span')	-- inline-block&lt;br /&gt;
			:addClass('zhuyin-rt')&lt;br /&gt;
			:tag('span')&lt;br /&gt;
				:addClass('zhuyin-rt-phon')&lt;br /&gt;
				:wikitext(bopo)&lt;br /&gt;
			:done()&lt;br /&gt;
			:tag('span')&lt;br /&gt;
				:addClass('zhuyin-rt-tone')&lt;br /&gt;
				:wikitext(tone)&lt;br /&gt;
	return ru&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Annotate objects in pinyin.&lt;br /&gt;
-- Pinyin orthography allow multiple characters to be annotated.&lt;br /&gt;
-- In this case, we might be adding a pinyin to multiple bopo-annotated pairs.&lt;br /&gt;
-- (And this of course applies to other romanisations of Chinese.)&lt;br /&gt;
function p._pinyin(tbl, pinyin, n)&lt;br /&gt;
	n = n or #tbl&lt;br /&gt;
	local ruby = mw.html.create('ruby')&lt;br /&gt;
	ruby:addClass('zhuyin-container')&lt;br /&gt;
	for i, v in ipairs(tbl) do&lt;br /&gt;
		ruby:node(v)&lt;br /&gt;
	end&lt;br /&gt;
	ruby:tag('rt')&lt;br /&gt;
		:attr('rbspan', tostring(n))&lt;br /&gt;
		:wikitext(pinyin)&lt;br /&gt;
	return ruby&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- This is for test.&lt;br /&gt;
function p.test()&lt;br /&gt;
	return p._pinyin({&lt;br /&gt;
		p._zhuyin1('謝', 'ㄒㄧㄝ', 'ˋ'),&lt;br /&gt;
		p._zhuyin1('謝', 'ㄒㄧㄝ', '˙')&lt;br /&gt;
	}, 'xièxie', 2)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Now the CSS still needs to be written. And the interface is obviously clumsy,&lt;br /&gt;
-- and not translatable to templates yet. The main problem is that we will need&lt;br /&gt;
-- to either separate the syllables themselves or come up with a way for the user&lt;br /&gt;
-- to express the separation in a template-string.&lt;br /&gt;
--&lt;br /&gt;
-- Also there's a point in tagging stuff with lang&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Zoran</name></author>
	</entry>
</feed>