Ugrás a tartalomhoz

Modul:CactaceaeTaxonok

Innen: MKOE wiki
A lap korábbi változatát látod, amilyen Dr. Gyúró Zoltán (vitalap | szerkesztései) 2026. január 7., 07:20-kor történt szerkesztése után volt.

A modult a Modul:CactaceaeTaxonok/doc lapon tudod dokumentálni

local p = {}

function p.tablazat(frame)
    -- Adatok betöltése külső modulból
    local status, adatModul = pcall(require, 'Modul:CactaceaeTaxonokData')
    if not status then return "Hiba: A 'Modul:CactaceaeTaxonokData' nem található!" end
    
    local nyers_adat = adatModul.getAdatok()

    local res = '{| class="wikitable sortable datatable-hook stripe hover compact" data-page-length="50" style="width:100%; font-size:90%;"\n'
    res = res .. "! # !! Taxonnév !! Típusfaj, szinonima\n"

    local sorszam = 0
    for sor in nyers_adat:gmatch("[^\r\n]+") do
        local taxon = ""
        local szinonimak = ""

        if sor:match("^ß") then
            local nemzettseg, tipus = sor:match("^ß%s*([^:]+)::%s*(.+)")
            if nemzettseg then
                taxon = mw.text.trim(nemzettseg):gsub("¤+", "")
                szinonimak = mw.text.trim(tipus):gsub("¤+", "")
            end
        elseif sor:match("^Ł") then
            local tiszta = sor:gsub("^Ł%s*", "")
            local t, sz = tiszta:match("([^¤]+)¤¤¤(.*)")
            if t then
                taxon = t
                szinonimak = sz:gsub("[¤đ÷]", ""):gsub("≡≡", "≡"):gsub("==", "=")
            end
        end

        if taxon ~= "" then
            sorszam = sorszam + 1
            res = res .. "|-\n"
            -- Sorszám
            res = res .. "| " .. sorszam .. "\n"
            -- Taxonnév (A white-space: nowrap megakadályozza a sortörést)
            res = res .. '| style="white-space: nowrap;" | ' .. mw.text.trim(taxon) .. "\n"
            -- Típusfaj / Szinonima
            res = res .. "| " .. mw.text.trim(szinonimak or "") .. "\n"
        end
    end

    res = res .. "|}"
    return res
end

return p