134 captures
24 Mar 2015 - 15 Jan 2026
Feb MAR Apr
14
2019 2020 2021
success
fail

About this capture

COLLECTED BY

Collection: Save Page Now

TIMESTAMPS

The Wayback Machine - http://web.archive.org/web/20200314120609/https://en.wikipedia.org/wiki/Module:Icon
 





Permanently protected module

Module:Icon



From Wikipedia, the free encyclopedia


Jump to navigation  Jump to search  

Module documentation[view] [edit] [history] [purge]

This module displays an icon depending on the code it is given. It implements Template:Icon.

Usage

From wikitext

From wikitext this module should be used via Template:Icon. Please see the template page for documentation.

From Lua

To use this module from another Lua module, first load it:

local mIcon = require('Module:Icon')

Then you can make icons with the _main function.

mIcon._main(args)

The args variable is a table of arguments. This corresponds to the parameters accepted by Template:Icon - please see the template page for parameter documentation.

Data

The icon data is stored at Module:Icon/data. See the instructions there for how to add and remove icons.

-- This module implements [[Template:Icon]].

local data = mw.loadData('Module:Icon/data')

local p = {}

function p._main(args)
 local code = args.class or args[1]
 local iconData
 if code then
  code = code:match('^%s*(.-)%s*$'):lower() -- trim whitespace and put in lower case
  iconData = data[code]
 end
 if not iconData then
  iconData = data._DEFAULT
 end
 return string.format(
  '[[File:%s%s|%s|link=]]',
  iconData.image,
  iconData.tooltip and '|' .. iconData.tooltip or '',
  args.size or '16x16px'
 )
end

function p.main(frame)
 local args = {}
 for k, v in pairs(frame:getParent().args) do
  args[k] = v
 end
 return p._main(args)
end

return p

Retrieved from "https://en.wikipedia.org/w/index.php?title=Module:Icon&oldid=643803192"

Categories: 
Modules subject to page protection
Hidden categories: 
Wikipedia template-protected modules







Navigation menu



Personal tools



Not logged in

Talk
Contributions
Create account
Log in
 



Namespaces



Module
Talk
 


Variants  







Views



Read
View source
View history
 


More  





 







Navigation  



Main page
Contents
Featured content
Current events
Random article
Donate to Wikipedia
Wikipedia store
 


Interaction  



Help
About Wikipedia
Community portal
Recent changes
Contact page
 


Tools  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Wikidata item
 


Print/export  



Download as PDF
 


Languages  



Afrikaans
العربية

Asturianu
Azərbaycanca
تۆرکجه

Bân-lâm-gú

Bikol Central
Bosanski
Català
Cymraeg
فارسی
Føroyskt

  / Gõychi Konknni
Bahasa Indonesia

Lietuvių
Magyar
Македонски
مصرى
 

Polski
Português
Scots
Simple English
Slovenščina
کوردی
Српски / srpski
Українська
اردو
Tiếng Vit


Edit links
 






This page was last edited on 23 January 2015, at 10:26 (UTC).

Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.
 


Privacy policy

About Wikipedia

Disclaimers

Contact Wikipedia

Developers

Statistics

Cookie statement

Mobile view
 


Wikimedia Foundation
Powered by MediaWiki