Module:InterPro content
Appearance
| This module is rated as beta. It is considered ready for widespread use, but as it is still relatively new, it should be applied with some caution to ensure results are as expected. |
| This module is currently protected from editing. See the protection policy and protection log for more details. Please discuss any changes on the talk page; you may submit an edit request to ask an administrator to make an edit if it is uncontroversial or supported by consensus. You may also request that this page be unprotected. |
| This module depends on the following other modules: |
This module implements {{InterPro content}}.
Usage
{{#invoke:InterPro content|function_name}}
local getArgs = require('Module:Arguments').getArgs
local p = {}
local function interproLink(entry)
return '[https://www.ebi.ac.uk/interpro/entry/' .. entry .. ' ' .. entry .. ']'
end
local function renderList(args)
local listRoot = mw.html.create('ul')
:addClass('hlist')
for _, e in ipairs(args) do
listRoot
:tag('li')
:wikitext(interproLink(e))
end
return listRoot
end
function p.main(frame)
local args = getArgs(frame)
if not args[1] then
return '<div class="error">[[Module:InterPro content]]: required argument 1 is missing</div>'
elseif not args[2] then
return '<div role="note" style="font-style: italic;">This article incorporates text from the public domain [[Pfam]] and [[InterPro]] ' .. interproLink(args[1]) .. '</div>'
else
return '<div role="note" style="font-style: italic;">This article incorporates text from the public domain [[Pfam]] and [[InterPro]] ' .. renderList(args) .. '</div>'
end
end
return p