Home
Random
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Create plant stub
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
require('strict') local p = {} local pargs = {} local function firstToUpper(str) return (str:gsub("^%l", string.upper)) end local function getArgs (frame, args) local parents = mw.getCurrentFrame():getParent() for k,v in pairs(parents.args) do --check content if v and v ~= "" then args[k]=v --parents.args[k] end end for k,v in pairs(frame.args) do --check content if v and v ~= "" then args[k]=v end end end p.main = function (frame) getArgs(frame,pargs) local genus = pargs['genus'] local species = pargs['species'] local common = pargs['common_name'] if not (genus and species) then return "ERROR: require genus and species parameter" end local output = "" local short = pargs['short'] or "Species of plant in the genus " ..pargs['genus'] output = output .. "{{short description|" .. short .. "}}" --speciesbox output = output .. "\n{{speciesbox" output = output .. "\n|image = " .. pargs['image'] or "" output = output .. "\n|genus = " .. genus .. "\n|species = " .. species output = output .. "\n}}" --lede output = output .. "\n'''''" .. firstToUpper(genus) .. " " .. species .. "'''''" if common then output = output .. ", also called the '''" .. common .. "'''," end output = output .. " is a species of " .. pargs['type'] or "flowering plant" .. "in the genus ''[[" ..genus "]]''" if pargs['distribution'] then output = output .. ", native to " .. pargs['distribution'] end output = output .. ". " .. (pargs['comment'] or "") -- subtaxa -- local subtaxa = pargs['subtaxa'] if subtaxa then output = output .. "\n==Subtaxa==" .. "\nThe following subtaxa are recognised:\n" frame.args[1] = subtaxa frame.args['nolink'] = true -- subspecies shouldn't be linked output = output .. require('Module:FishRef/utilities').format_species_list(frame) --output = output .. end -- end stuff output = output .. "\n==References==" output = output .. "\n{{reflist}}" output = output .. "\n\n{{taxonbar|from1=" .. (pargs['taxonbar'] or "") .. "}}" output = output .. "\n" .. pargs['categories'] or "" return output end return p
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Module:Create plant stub/doc
(
edit
)