Module:rhymes: Difference between revisions

Jump to navigation Jump to search
ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
No edit summary
No edit summary
Line 22: Line 22:
end
end


function export.generate(lang, rhymes, nopre)
function export.generate(lang, rhymes, nopre, nocat)
     local language = m_languages.get_by_code(lang)
     local language = m_languages.get_by_code(lang)
     local rhymes_show = ""
     local rhymes_show = ""
if not nopre then
if not (nopre or false) then
rhymes_show = "\n* Rhyme"
rhymes_show = "\n* Rhyme"
if #rhymes > 1 then rhymes_show = rhymes_show .. "s" end  
if #rhymes > 1 then rhymes_show = rhymes_show .. "s" end  
Line 40: Line 40:
         if rhyme_count < 2 then
         if rhyme_count < 2 then
         rhymes_show = rhymes_show ..
         rhymes_show = rhymes_show ..
         "<span class=\"IPA\">-" .. rhyme .. "</span>[[Category:" .. rhyme_cat .. "]]"
         "<span class=\"IPA\">-" .. rhyme .. "</span>"
     else
     else
             rhymes_show = rhymes_show ..
             rhymes_show = rhymes_show ..
                 "<span class=\"IPA\">[[:Category:" .. rhyme_cat .. "|-" .. rhyme .. "]]</span>[[Category:" .. rhyme_cat .. "]]" ..
                 "<span class=\"IPA\">[[:Category:" .. rhyme_cat .. "|-" .. rhyme .. "]]</span>" ..
                 "<sup> (" .. rhyme_count .. ")</sup>"
                 "<sup> (" .. rhyme_count .. ")</sup>"
         end
         end
        if not (nocat or false) then
        rhymes_show = rhymes_show .. "[[Category:" .. rhyme_cat .. "]]"
    end
     end
     end
      
      
Line 76: Line 79:
mw.logObject(rhymes)
mw.logObject(rhymes)


return export.generate(language.code, rhymes, args["nopre"] ~= nil)
return export.generate(language.code, rhymes, args["nopre"] ~= nil, args["nocat"] ~= nil)
end
end


Navigation menu