Modulo:Babel: Malsamoj inter versioj

[kontrolita revizio][kontrolita revizio]
Enhavo forigita Enhavo aldonita
e korekto
aldono, korekto laŭ la modula provejo
Linio 1:
-- Babel -- 2015061320150614
 
function subtitle(text)
Linio 18:
end
 
function beginonly (text,s,c)
-- changes html codes for the tabel's beginning into wiki codes
-- removes the end of the table
-- html
local b1 = '<table class="userboxes"'
local b2 = '><tr><th colspan="' .. s .. '" style="background%-color:' .. c .. ';text%-align:center">'
local b3 = "</th></tr><tr>"
-- wiki code
local b1w = '{| class="userboxes"'
local b2w = '\n|-\n! colspan="' .. s .. '" style="background-color:' .. c .. ';text-align:center" | '
local b3w = "\n<tr>"
local r = text
r = mw.ustring.gsub(r,b1,b1w,1) -- <table ... -> {| ...
r = mw.ustring.gsub(r,b2,b2w,1) -- <tr><th> ... -> |- !
r = mw.ustring.gsub(r,b3,b3w,1) -- </tr><tr> -> <tr>
r = mw.ustring.sub(r,1,-9) -- </table> -> nothing
return r
end
 
local p = {}
Linio 242 ⟶ 263:
if (args.header ~= "sen") and (args.kaplinio ~= "sen") then
local header = args.header or args.kaplinio
row1:tag('th')
:css({ ['background-color'] = color,
['text-align'] = 'center' })
:attr('colspan',col_span)
:wikitext( args.header or '[[Vikipedio:Babelejo]]' )
:done()
end
 
if (args.footer ~= "sen") and (args.piedlinio ~="sen") then
local footer = args.footer or args.piedlinio
row3:tag('td')
:css({ ['background-color'] = color,
['text-align'] = 'center' })
:attr('colspan',col_span)
:wikitext( args.footer or '[[:Kategorio:Vikipediistoj laŭ lingvo|Uzantoj laŭ lingvo]]' )
:done()
end
Linio 330 ⟶ 353:
body_cells:done()
local result = tostring(ret)
-- change the html coding of the tabel's beginning into wiki code
-- remove the end of the html coding of the table
if args['begin only'] =="yes" or args['nur komenco'] =="jes" then
local s = col_span
result = beginonly (result,s,color)
end
return tostring(ret)result
end