Content deleted Content added
Changing to use subsections. Problem: for some reason the new \n's want to come out as "\n", even though I had some already which appear as newline. |
what is up with those newlines, hmmm... |
||
Line 16:
header = frame:expandTemplate{ title = 'Wikipedia:Good articles/header', args = { shortcuts = shortcuts } }
end
local
replace = function(t)
local xxxx, links = mw.ustring.gsub(t, "(%[%[[^%[%]]-%]%])", "%1", nil) -- count how many links
Line 24:
return t .. "\n"
end
local sectionfooter = [===[
</div> </div> <!-- end of list -->]===] -- comments in the text below are historical from the page's own markup
local output = header .. [===[<!-- only include header on this page -->
Line 37 ⟶ 40:
</div>
</div>
]===] ..
local section = 0
local finaltext = ''
repeat
local wrap = true
section = section + 1
local text = (args['section' .. tostring(section)] or '')
if (not title) then
if (text == '') then break end -- no more sections
else
local wrap = false
output = output .. text
end
if wrap then
local image = args['image' .. tostring(section)] local text = mw.ustring.gsub(text, "(==.-)\n%f[=]", replace)▼
if (image) then
▲ local text = mw.ustring.gsub(text, "(==.-)\n%f[=]", replace)
else
image = '' -- make section without an image
end
output = output .. [===[<div style="clear:both;" class="NavFrame">
<span id="World history"/>
<div class="NavContent" style="text-align:left;">
==­ ==
]===] .. text .. sectionfooter
else
end
▲ output = output .. [===[<div style="clear:both;" class="NavFrame">\n<span id="World history"/>\n<div class="NavHead" style="padding:2px 2px 2px 30px; background-color:#FFFAF0; text-align:left; font-size:larger;">]===] .. image .. title .. [===[</div>\n<div class="NavContent" style="text-align:left;">\n\n==­ ==\n]===] .. text .. sectionfooter
until false
return output
end
|