Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Revision as of 13:17, 2 December 2020 by commons>Sarang (first version)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Module documentation[ view · edit · history · purge ]
This documentation is transcluded from Module:Dsize/doc.

This module contains very few code - but it is heavily used.
It is needed to verify that a given display size is trailed by "px".
It can be expanded to check for other dimensions, as e.g. "em".

it will be used by Template:F, Created with/layout, ...

Use it with e.g. {{#invoke:Dsize|main|{{{sizepar}}} }}

Examples:
{{#invoke:Dsize|main|72px}} 72px width
{{#invoke:Dsize|main|72}} 72px width
{{#invoke:Dsize|main|72x}} 72xpx width
{{#invoke:Dsize|main|x64px}} x64px height
{{#invoke:Dsize|main|72x64}} 0 72x64px 0 w × h

Module:Galeria has a similar but more powerful and complex function.

local p = {}
function p.main ( frame )
	local gpar = frame.args
	if  mw.ustring.sub(gpar[1], -2) == 'px' then
		return gpar[1];
	else
		return gpar[1] .. 'px';
	end
end
return p;
Cookies help us deliver our services. By using our services, you agree to our use of cookies.