Naar inhoud springen

Module:Alphabet

Uit Wikibooks

(MediaWiki:Scribunto-doc-page-show)

Te gebruiken via Sjabloon:Alfabet met ankers.


local p = {}

function p.az_anchors(frame)
 local temp = ""

 -- A-Z:
 for i = 65, 90 do                                                             
  temp = temp .. "[[#" .. string.char(i) .. "|" .. string.char(i) .. "]]"
  if i  < 90 then temp = temp .. " &middot; " end                            -- after "Z": no middot
  if i == 77 then temp = temp .. '<span style="white-space: nowrap;">' end   -- after "M": begin nowrap
 end

 -- max. 3 extra characters:
 for j = 1, 3 do
  if type(frame.args[j]) == "string" and string.len(frame.args[j]) > 0 then
   temp = temp .. " &middot; [[#" .. frame.args[j] .. "|" .. frame.args[j] .. "]]"
  end
 end

 temp = temp .. "</span>"                                                    -- end nowrap
 
 return temp
end

return p
Informatie afkomstig van Wikibooks NL, een onderdeel van de Wikimedia Foundation.