Technopedia Center
PMB University Brochure
Faculty of Engineering and Computer Science
S1 Informatics S1 Information Systems S1 Information Technology S1 Computer Engineering S1 Electrical Engineering S1 Civil Engineering

faculty of Economics and Business
S1 Management S1 Accountancy

Faculty of Letters and Educational Sciences
S1 English literature S1 English language education S1 Mathematics education S1 Sports Education
  • Registerasi
  • Brosur UTI
  • Kip Scholarship Information
  • Performance
  1. Weltenzyklopädie
  2. Module:DemoTemplate — Wikipédia
Module:DemoTemplate — Wikipédia 👆 Click Here! Read More..
Une page de Wikipédia, l'encyclopédie libre.

 Documentation[voir] [modifier] [historique] [purger]

Utilisation

[modifier le code]

Ajouter #invoke:DemoTemplate| au début d'un modèle pour le transfomer en démo de ce modèle. Par exemple

{{#invoke:DemoTemplate|Date|25|décembre|1916|julien=oui|âge=oui}} 

affiche : {{Date|25|décembre|1916|âge=oui|julien=oui}} → 25 décembre 1916 (7 janvier 1917 dans le calendrier grégorien) (108 ans)

Ce module gère correctement les paramètres « non nommé » avec signe égal. Ainsi

{{#invoke:DemoTemplate|Rouge|1=Paramètre avec contenant un signe = (égal)}}

affiche : {{Rouge|1=Paramètre avec contenant un signe = (égal)}} → Paramètre avec contenant un signe = (égal)

Par contre il ne gère pas les pipe, parenthèses, crochet... donc

{{#invoke:DemoTemplate|Rouge|foo{{!}}bar}}

affiche : {{Rouge|foo|bar}} → foo

    • Projet Scribunto Projet Scribunto

La documentation de ce module est générée par le modèle {{Documentation module}}.
Elle est incluse depuis sa sous-page de documentation. Veuillez placer les catégories sur cette page-là.
Les éditeurs peuvent travailler dans le bac à sable (créer).
Voir les statistiques d'appel depuis le wikicode sur l'outil wstat et les appels depuis d'autres modules.

local mt = {}

function mt.__index( t, title )
	return function( frame )
		local wikiTable = {}
		table.insert( wikiTable, '{{' .. title )
		local ipairsArgs = {}
		for k, v in ipairs( frame.args ) do
			if string.find( v, '=', 1, true) then
				break
			end
			ipairsArgs[k] = true
			table.insert( wikiTable, '|' .. v )
		end
		for k, v in pairs( frame.args ) do
			if not ipairsArgs[k] then
				table.insert( wikiTable, '|' .. k .. '=' .. v )
			end
		end
		table.insert( wikiTable, '}}' )
		local wikiText = table.concat( wikiTable )
		-- rather than calling expandTemplate with the title and args we have, call preprocess, so that our code example will always match our output, even in the cases of pipes or other things we should have escaped but didn't
		return string.format(
			'<code>%s</code> &rarr; %s', 
			mw.text.nowiki( wikiText ), 
			frame:preprocess( wikiText )
		)
	end
end

return setmetatable({}, mt)
Ce document provient de « https://fr.teknopedia.teknokrat.ac.id/w/index.php?title=Module:DemoTemplate&oldid=122103157 ».
Catégorie :
  • Module en langage Lua

  • indonesia
  • Polski
  • الرية
  • Deutsch
  • English
  • Español
  • Français
  • Italiano
  • مصر
  • Nederlands
  • 本語
  • Português
  • Sinugboanong Binisaya
  • Svenska
  • Українска
  • Tiếng Việt
  • Winaray
  • 中文
  • Русски
Sunting pranala
Pusat Layanan

UNIVERSITAS TEKNOKRAT INDONESIA | ASEAN's Best Private University
Jl. ZA. Pagar Alam No.9 -11, Labuhan Ratu, Kec. Kedaton, Kota Bandar Lampung, Lampung 35132
Phone: (0721) 702022
Email: pmb@teknokrat.ac.id