-
WikiChip
WikiChip
-
Architectures
Popular x86
-
Intel
- Client
- Server
- Big Cores
- Small Cores
-
AMD
Popular ARM
-
ARM
- Server
- Big
- Little
-
Cavium
-
Samsung
-
-
Chips
Popular Families
-
Ampere
-
Apple
-
Cavium
-
HiSilicon
-
MediaTek
-
NXP
-
Qualcomm
-
Renesas
-
Samsung
-
From WikiChip
Module:chip
To add this template, simple add
{{chip}}to the page and save. The chip infobox will have a small
[Edit Values]
button at the top-right corner which can be used to add values using a form.
local p = {}
function p.add_file_prefix(str)
if string.match(string.lower(str), '^file:') then
return str
else
return 'File:' .. str
end
end
function p.chip(frame)
local infobox = mw.html.create('table')
infobox
:attr('class', 'chip-infobox')
-- header
if frame.args.title then
infobox
:tag('tr')
:tag('td')
:attr('class', 'chip-infobox-header')
:attr('colspan', '2')
:wikitext('[[name::' .. frame.args.title .. ']]')
else
infobox
:tag('tr')
:tag('td')
:attr('style', 'font-weight: bold; font-size 1.2em; font-color: red;')
:wikitext('ERROR: MISSING TITLE!')
end
-- image
if frame.args.image then
local image = p.add_file_prefix(frame.args.image)
infobox
:tag('tr')
:tag('td')
:attr('class', 'chip-infobox-pic')
:attr('colspan', '2')
:wikitext('[[image::' .. image .. '| ]][[' .. image .. ']]')
end
return infobox
end
return p
Retrieved from "https://en.wikichip.org/w/index.php?title=Module:chip&oldid=32460"