local p = {}
local getArgs = require('Module:Arguments').getArgs
function p.main(frame)
local args = getArgs(frame, {wrappers = 'Template:ZyPy'})
local ruby = mw.html.create('ruby'):css('text-align', 'justify'):css('text-justify', 'none')
local rb = ruby:tag('rb'):addClass('center'):wikitext(args[1])
local rpl = ruby:tag('rp'):css('user-select', 'none'):wikitext('(')
local zy = args[2]
if args[3] and args[4] then
zy = '-{zh-cn:' .. zy .. ';zh-tw:' .. args[3] .. ';zh-hk:' .. args[4] .. ';}-'
elseif args[3] then
zy = '-{zh-cn:' .. zy .. ';zh-tw:' .. args[3] .. ';}-'
end
local rt = ruby:tag('rt'):cssText('font-feature-settings: "ruby" 1; font-size: 90%; user-select: none;'):wikitext(zy)
local rpr = ruby:tag('rp'):css('user-select', 'none'):wikitext(')')
return ruby
end
return p
Wikiwand in your browser!
Seamless Wikipedia browsing. On steroids.
Every time you click a link to Wikipedia, Wiktionary or Wikiquote in your browser's search results, it will show the modern Wikiwand interface.
Wikiwand extension is a five stars, simple, with minimum permission required to keep your browsing private, safe and transparent.