Wikipedija hsbwiki https://hsb.wikipedia.org/wiki/H%C5%82owna_strona MediaWiki 1.47.0-wmf.2 first-letter Media Specialnje Diskusija Wužiwar Diskusija z wužiwarjom Wikipedija Wikipedija diskusija Dataja Diskusija k dataji MediaWiki MediaWiki diskusija Předłoha Diskusija k předłoze Pomoc Pomoc diskusija Kategorija Diskusija ke kategoriji TimedText TimedText talk Modul Modul diskusija Veranstaltung Veranstaltung Diskussion Wikipedija:Lua/Module/LuaWiki/en 4 22757 390994 301832 2026-05-17T12:20:16Z Nimmzo 28254 /* {{Anchor|Lua}} Functions for Lua modules (API) */ Introducing the tutorial to run [[Modul:LuaWiki]] in Debug console 390994 wikitext text/x-wiki {{LuaModuleDoc}} <onlyinclude> '''<code>LuaWiki</code>''' – Module with functions for Lua programming in context of a Wiki project. <noinclude>__TOC__</noinclude> == {{Anchor|template}} Functions for templates == No direct usage by templates. == {{Anchor|Lua}} Functions for Lua modules (API) == The Lua Scribunto <code>Debug Console</code> is a safe, interactive tool for learning Modul:LuaWiki. # Click <code>Edit source</code> on the [[Modul:LuaWiki]] page. # Do '''not''' modify the Lua code in the editor and do <span style="color:#ff0000;">'''not'''</span> click <code>Publish changes</code>. # Scroll to the bottom of the page to the <code>Debug console</code> section. # Paste the following into the <span style="color:#86888c;">gray</span> input box (above the <code>Clear</code> button). <syntaxhighlight lang="lua"> local LuaWiki = require( "Module:LuaWiki" ) if type( LuaWiki ) == "table" then LuaWiki.setFrame( frame ) else -- appropriate error management; e.g. message within functions for templates end </syntaxhighlight> Thereafter the functions can be accessed; do not forget [[#init|initialization]]. ; LuaWiki.getArg( arg, assign ) : Retrieve template argument :* <code>arg</code> – ''string'' or ''number''; argument identifier :* <code>assign</code> – optional; default value of any type, if not provided in template transclusion :* Returns: string (ensured) or default value orherwise : If not set in template transclusion and no default value, then: <code>{{{&lt;</code>''arg''<code>>}}}</code> ; LuaWiki.getVariable( seek, numeric ) : Retrieve item from wikiVariables; populate if not yet present; see [[:de:Hilfe:Variablen]] :* <code>seek</code> – ''string''; name of variable, like <code>"PAGENAME"</code> :* <code>numeric</code> – ''boolean'', optional; true: seek is numeric (else string) :* Returns: ''string'' or ''number'' : Previous initialization with ''initVariables'' accelerates but ist not mandatory. ; LuaWiki.initVariables( request ) : Initialization of some required variables for acceleration :* <code>request</code> – ''table''; selection of variables :*: every element either: :*:* ''string''; name of variable, like <code>"PAGENAME"</code> :*:* ''table''; variable is always returned as numerical value :*:** [1] ''string''; name of variable :*:** [2] <code>true</code> :* Returns: ''none'' ; LuaWiki.isExisting( seek ) : Test page existence; like <code>#ifexist</code> :* <code>seek</code> – ''string''; full page name :* Returns: ''boolean'' ; LuaWiki.setFrame( frame ) : Initialize frame for this utility by current template environment :* <code>frame</code> – <code>frame</code> object :* Returns: ''none'' ; LuaWiki.transclude( s, args ) : Save transclusion of a page, or error message :* <code>s</code> – ''string''; full page name (if namespace not provided <code>Template:</code> will be used) :* <code>args</code> – ''table'', optional; arguments :* Returns: ''string''; transclusion or error message if page missing {{Anchor|init}} The initialization is important: On start the <code>frame</code> object of current template environment needs to be set by <code style="white-space: nowrap">LuaWiki.setFrame( frame )</code>&nbsp;– this won’t be checked any more. == Usage == General library; no limitations. == Dependencies == None. == Origin == * [[:de:Vorlage:LuaWiki]] - 2013-05-04 7rtfoswvrdsuz2gn09s8gvpewgqyqhr 390995 390994 2026-05-17T12:30:31Z Nimmzo 28254 /* {{Anchor|Lua}} Functions for Lua modules (API) */ syntaxhighlight: +line +highlight +copy. Removed deprecated LuaWiki.setFrame(frame) no longer present in [[Modul:LuaWiki]] 390995 wikitext text/x-wiki {{LuaModuleDoc}} <onlyinclude> '''<code>LuaWiki</code>''' – Module with functions for Lua programming in context of a Wiki project. <noinclude>__TOC__</noinclude> == {{Anchor|template}} Functions for templates == No direct usage by templates. == {{Anchor|Lua}} Functions for Lua modules (API) == The Lua Scribunto <code>Debug Console</code> is a safe, interactive tool for learning Modul:LuaWiki. # Click <code>Edit source</code> on the [[Modul:LuaWiki]] page. # Do '''not''' modify the Lua code in the editor and do <span style="color:#ff0000;">'''not'''</span> click <code>Publish changes</code>. # Scroll to the bottom of the page to the <code>Debug console</code> section. # Paste the following into the <span style="color:#86888c;">gray</span> input box (above the <code>Clear</code> button). <blockquote><syntaxhighlight lang="lua" line highlight=1 copy> local LuaWiki = require( "Modul:LuaWiki" ) -- load the LuaWiki module print(type(LuaWiki)) -- A Lua module must return a table print(LuaWiki.isExisting("Modul:LuaWiki")) -- Does Modul:LuaWiki exist? print(LuaWiki.getVariable("PAGENAME", false)) -- Get the title of the current page </syntaxhighlight></blockquote> Thereafter the functions can be accessed; do not forget [[#init|initialization]]. ; LuaWiki.getArg( arg, assign ) : Retrieve template argument :* <code>arg</code> – ''string'' or ''number''; argument identifier :* <code>assign</code> – optional; default value of any type, if not provided in template transclusion :* Returns: string (ensured) or default value orherwise : If not set in template transclusion and no default value, then: <code>{{{&lt;</code>''arg''<code>>}}}</code> ; LuaWiki.getVariable( seek, numeric ) : Retrieve item from wikiVariables; populate if not yet present; see [[:de:Hilfe:Variablen]] :* <code>seek</code> – ''string''; name of variable, like <code>"PAGENAME"</code> :* <code>numeric</code> – ''boolean'', optional; true: seek is numeric (else string) :* Returns: ''string'' or ''number'' : Previous initialization with ''initVariables'' accelerates but ist not mandatory. ; LuaWiki.initVariables( request ) : Initialization of some required variables for acceleration :* <code>request</code> – ''table''; selection of variables :*: every element either: :*:* ''string''; name of variable, like <code>"PAGENAME"</code> :*:* ''table''; variable is always returned as numerical value :*:** [1] ''string''; name of variable :*:** [2] <code>true</code> :* Returns: ''none'' ; LuaWiki.isExisting( seek ) : Test page existence; like <code>#ifexist</code> :* <code>seek</code> – ''string''; full page name :* Returns: ''boolean'' ; LuaWiki.setFrame( frame ) : Initialize frame for this utility by current template environment :* <code>frame</code> – <code>frame</code> object :* Returns: ''none'' ; LuaWiki.transclude( s, args ) : Save transclusion of a page, or error message :* <code>s</code> – ''string''; full page name (if namespace not provided <code>Template:</code> will be used) :* <code>args</code> – ''table'', optional; arguments :* Returns: ''string''; transclusion or error message if page missing {{Anchor|init}} The initialization is important: On start the <code>frame</code> object of current template environment needs to be set by <code style="white-space: nowrap">LuaWiki.setFrame( frame )</code>&nbsp;– this won’t be checked any more. == Usage == General library; no limitations. == Dependencies == None. == Origin == * [[:de:Vorlage:LuaWiki]] - 2013-05-04 kpvb0seldf480pb1wlyomv08c5gt2ox 390999 390995 2026-05-17T13:20:08Z Nimmzo 28254 /* {{Anchor|Lua}} Functions for Lua modules (API) */ Added expected result in Debug console. For the Enter key (↲), created [[Předłoha:Key press]], [[Předłoha:Key press/styles.css]], and Lua [[Modul:Key]] 390999 wikitext text/x-wiki {{LuaModuleDoc}} <onlyinclude> '''<code>LuaWiki</code>''' – Module with functions for Lua programming in context of a Wiki project. <noinclude>__TOC__</noinclude> == {{Anchor|template}} Functions for templates == No direct usage by templates. == {{Anchor|Lua}} Functions for Lua modules (API) == The Lua Scribunto <code>Debug Console</code> is a safe, interactive tool for learning Modul:LuaWiki. # Click <code>Edit source</code> on the [[Modul:LuaWiki]] page. # Do '''not''' modify the Lua code in the editor and do <span style="color:#ff0000;">'''not'''</span> click <code>Publish changes</code>. # Scroll to the bottom of the page to the <code>Debug console</code> section. # Paste the following into the <span style="color:#86888c;">gray</span> input box (above the <code>Clear</code> button). <blockquote><syntaxhighlight lang="lua" line highlight=1 copy> local LuaWiki = require( "Modul:LuaWiki" ) -- load the LuaWiki module print(type(LuaWiki)) -- A Lua module must return a table print(LuaWiki.isExisting("Modul:LuaWiki")) -- Does Modul:LuaWiki exist? print(LuaWiki.getVariable("PAGENAME", false)) -- Get the title of the current page </syntaxhighlight></blockquote> <ol start="5"> <li>Press {{key press|Enter}} once to execute all Lua command''s''.</li> <li>The result will appear below the Lua <syntaxhighlight lang="lua" inline>print</syntaxhighlight> command line:</li> </ol> <blockquote><syntaxhighlight lang="lua" line start=5> table true LuaWiki </syntaxhighlight></blockquote> Thereafter the functions can be accessed; do not forget [[#init|initialization]]. ; LuaWiki.getArg( arg, assign ) : Retrieve template argument :* <code>arg</code> – ''string'' or ''number''; argument identifier :* <code>assign</code> – optional; default value of any type, if not provided in template transclusion :* Returns: string (ensured) or default value orherwise : If not set in template transclusion and no default value, then: <code>{{{&lt;</code>''arg''<code>>}}}</code> ; LuaWiki.getVariable( seek, numeric ) : Retrieve item from wikiVariables; populate if not yet present; see [[:de:Hilfe:Variablen]] :* <code>seek</code> – ''string''; name of variable, like <code>"PAGENAME"</code> :* <code>numeric</code> – ''boolean'', optional; true: seek is numeric (else string) :* Returns: ''string'' or ''number'' : Previous initialization with ''initVariables'' accelerates but ist not mandatory. ; LuaWiki.initVariables( request ) : Initialization of some required variables for acceleration :* <code>request</code> – ''table''; selection of variables :*: every element either: :*:* ''string''; name of variable, like <code>"PAGENAME"</code> :*:* ''table''; variable is always returned as numerical value :*:** [1] ''string''; name of variable :*:** [2] <code>true</code> :* Returns: ''none'' ; LuaWiki.isExisting( seek ) : Test page existence; like <code>#ifexist</code> :* <code>seek</code> – ''string''; full page name :* Returns: ''boolean'' ; LuaWiki.setFrame( frame ) : Initialize frame for this utility by current template environment :* <code>frame</code> – <code>frame</code> object :* Returns: ''none'' ; LuaWiki.transclude( s, args ) : Save transclusion of a page, or error message :* <code>s</code> – ''string''; full page name (if namespace not provided <code>Template:</code> will be used) :* <code>args</code> – ''table'', optional; arguments :* Returns: ''string''; transclusion or error message if page missing {{Anchor|init}} The initialization is important: On start the <code>frame</code> object of current template environment needs to be set by <code style="white-space: nowrap">LuaWiki.setFrame( frame )</code>&nbsp;– this won’t be checked any more. == Usage == General library; no limitations. == Dependencies == None. == Origin == * [[:de:Vorlage:LuaWiki]] - 2013-05-04 b1pdjh997g0j6gakr3utnot1mgsa35g 391000 390999 2026-05-17T13:30:10Z Nimmzo 28254 /* {{Anchor|Lua}} Functions for Lua modules (API) */ End of Debug console user manual 391000 wikitext text/x-wiki {{LuaModuleDoc}} <onlyinclude> '''<code>LuaWiki</code>''' – Module with functions for Lua programming in context of a Wiki project. <noinclude>__TOC__</noinclude> == {{Anchor|template}} Functions for templates == No direct usage by templates. == {{Anchor|Lua}} Functions for Lua modules (API) == The Lua Scribunto <code>Debug Console</code> is a safe, interactive tool for learning Modul:LuaWiki. # Click <code>Edit source</code> on the [[Modul:LuaWiki]] page. # Do '''not''' modify the Lua code in the editor and do <span style="color:#ff0000;">'''not'''</span> click <code>Publish changes</code>. # Scroll to the bottom of the page to the <code>Debug console</code> section. # Paste the following into the <span style="color:#86888c;">gray</span> input box (above the <code>Clear</code> button). <blockquote><syntaxhighlight lang="lua" line highlight=1 copy> local LuaWiki = require( "Modul:LuaWiki" ) -- load the LuaWiki module print(type(LuaWiki)) -- A Lua module must return a table print(LuaWiki.isExisting("Modul:LuaWiki")) -- Does Modul:LuaWiki exist? print(LuaWiki.getVariable("PAGENAME", false)) -- Get the title of the current page </syntaxhighlight></blockquote> <ol start="5"> <li>Press {{key press|Enter}} once to execute all Lua command''s''.</li> <li>The result will appear below the Lua <syntaxhighlight lang="lua" inline>print</syntaxhighlight> command line:</li> </ol> <blockquote><syntaxhighlight lang="lua" line start=5> table true LuaWiki </syntaxhighlight></blockquote> <ol start="7"> <li>Press <code>Up arrow</code> (↑) to cycle through previous Lua commands.</li> <li>Optionally, click <code>Clear</code> to clear ''only'' the <code>Debug Console</code>; the Lua editor above will remain '''un'''modified.</li> </ol> Thereafter the functions can be accessed; do not forget [[#init|initialization]]. ; LuaWiki.getArg( arg, assign ) : Retrieve template argument :* <code>arg</code> – ''string'' or ''number''; argument identifier :* <code>assign</code> – optional; default value of any type, if not provided in template transclusion :* Returns: string (ensured) or default value orherwise : If not set in template transclusion and no default value, then: <code>{{{&lt;</code>''arg''<code>>}}}</code> ; LuaWiki.getVariable( seek, numeric ) : Retrieve item from wikiVariables; populate if not yet present; see [[:de:Hilfe:Variablen]] :* <code>seek</code> – ''string''; name of variable, like <code>"PAGENAME"</code> :* <code>numeric</code> – ''boolean'', optional; true: seek is numeric (else string) :* Returns: ''string'' or ''number'' : Previous initialization with ''initVariables'' accelerates but ist not mandatory. ; LuaWiki.initVariables( request ) : Initialization of some required variables for acceleration :* <code>request</code> – ''table''; selection of variables :*: every element either: :*:* ''string''; name of variable, like <code>"PAGENAME"</code> :*:* ''table''; variable is always returned as numerical value :*:** [1] ''string''; name of variable :*:** [2] <code>true</code> :* Returns: ''none'' ; LuaWiki.isExisting( seek ) : Test page existence; like <code>#ifexist</code> :* <code>seek</code> – ''string''; full page name :* Returns: ''boolean'' ; LuaWiki.setFrame( frame ) : Initialize frame for this utility by current template environment :* <code>frame</code> – <code>frame</code> object :* Returns: ''none'' ; LuaWiki.transclude( s, args ) : Save transclusion of a page, or error message :* <code>s</code> – ''string''; full page name (if namespace not provided <code>Template:</code> will be used) :* <code>args</code> – ''table'', optional; arguments :* Returns: ''string''; transclusion or error message if page missing {{Anchor|init}} The initialization is important: On start the <code>frame</code> object of current template environment needs to be set by <code style="white-space: nowrap">LuaWiki.setFrame( frame )</code>&nbsp;– this won’t be checked any more. == Usage == General library; no limitations. == Dependencies == None. == Origin == * [[:de:Vorlage:LuaWiki]] - 2013-05-04 nm7d0x1ja7dwenuslyzbf1ga9ssuuwu 391001 391000 2026-05-17T13:40:11Z Nimmzo 28254 /* {{Anchor|Lua}} Functions for Lua modules (API) */ Deprecated initialization is in HTM comment because LuaWiki.setFrame(frame) has been deleted from [[Modul:LuaWiki]]. Added LuaWiki.error(msg) with more than one single letter for the input parameter 391001 wikitext text/x-wiki {{LuaModuleDoc}} <onlyinclude> '''<code>LuaWiki</code>''' – Module with functions for Lua programming in context of a Wiki project. <noinclude>__TOC__</noinclude> == {{Anchor|template}} Functions for templates == No direct usage by templates. == {{Anchor|Lua}} Functions for Lua modules (API) == The Lua Scribunto <code>Debug Console</code> is a safe, interactive tool for learning Modul:LuaWiki. # Click <code>Edit source</code> on the [[Modul:LuaWiki]] page. # Do '''not''' modify the Lua code in the editor and do <span style="color:#ff0000;">'''not'''</span> click <code>Publish changes</code>. # Scroll to the bottom of the page to the <code>Debug console</code> section. # Paste the following into the <span style="color:#86888c;">gray</span> input box (above the <code>Clear</code> button). <blockquote><syntaxhighlight lang="lua" line highlight=1 copy> local LuaWiki = require("Modul:LuaWiki") -- load the LuaWiki module print(type(LuaWiki)) -- A Lua module must return a table print(LuaWiki.isExisting("Modul:LuaWiki")) -- Does Modul:LuaWiki exist? print(LuaWiki.getVariable("PAGENAME", false)) -- Get the title of the current page </syntaxhighlight></blockquote> <ol start="5"> <li>Press {{key press|Enter}} once to execute all Lua command''s''.</li> <li>The result will appear below the Lua <syntaxhighlight lang="lua" inline>print</syntaxhighlight> command line:</li> </ol> <blockquote><syntaxhighlight lang="lua" line start=5> table true LuaWiki </syntaxhighlight></blockquote> <ol start="7"> <li>Press <code>Up arrow</code> (↑) to cycle through previous Lua commands.</li> <li>Optionally, click <code>Clear</code> to clear ''only'' the <code>Debug Console</code>; the Lua editor above will remain '''un'''modified.</li> </ol> Thereafter the functions can be accessed<!-- Obsolete; do not forget [[#init|initialization]]-->. ; LuaWiki.getArg(arg, assign) : Retrieve template argument :* <code>arg</code> – ''string'' or ''number''; argument identifier :* <code>assign</code> – optional; default value of any type, if not provided in template transclusion :* Returns: string (ensured) or default value orherwise : If not set in template transclusion and no default value, then: <code>{{{&lt;</code>''arg''<code>>}}}</code> ; LuaWiki.getVariable(seek, numeric) : Retrieve item from wikiVariables; populate if not yet present; see [[:de:Hilfe:Variablen]] :* <code>seek</code> – ''string''; name of variable, like <code>"PAGENAME"</code> :* <code>numeric</code> – ''boolean'', optional; true: seek is numeric (else string) :* Returns: ''string'' or ''number'' : Previous initialization with ''initVariables'' accelerates but ist not mandatory. ; LuaWiki.initVariables(request) : Initialization of some required variables for acceleration :* <code>request</code> – ''table''; selection of variables :*: every element either: :*:* ''string''; name of variable, like <code>"PAGENAME"</code> :*:* ''table''; variable is always returned as numerical value :*:** [1] ''string''; name of variable :*:** [2] <code>true</code> :* Returns: ''none'' ; LuaWiki.isExisting(seek) : Test page existence; like <code>#ifexist</code> :* <code>seek</code> – ''string''; full page name :* Returns: ''boolean'' ; <s>LuaWiki.setFrame(frame)</s> : Deprecated: Initialize frame for this utility by current template environment :* <code>frame</code> – <code>frame</code> object :* Returns: ''none'' ; LuaWiki.transclude(s, args) : Save transclusion of a page, or error message :* <code>s</code> – ''string''; full page name (if namespace not provided <code>Template:</code> will be used) :* <code>args</code> – ''table'', optional; arguments :* Returns: ''string''; transclusion or error message if page missing ; LuaWiki.error(msg) : HTML generator of error message :* <code>msg</code> – ''string''; error message :* Returns: ''string''; HTML error message <!-- Obsolete {{Anchor|init}} The initialization is important: On start the <code>frame</code> object of current template environment needs to be set by <code style="white-space: nowrap">LuaWiki.setFrame( frame )</code>&nbsp;– this won’t be checked any more. --> == Usage == General library; no limitations. == Dependencies == None. == Origin == * [[:de:Vorlage:LuaWiki]] - 2013-05-04 lg6cumxpxxeyd7lqoyms2dvc8v7kttm 391003 391001 2026-05-17T14:00:21Z Nimmzo 28254 /* {{Anchor|Lua}} Functions for Lua modules (API) */ Added the call of LuaWiki.getArg and LuaWiki.error 391003 wikitext text/x-wiki {{LuaModuleDoc}} <onlyinclude> '''<code>LuaWiki</code>''' – Module with functions for Lua programming in context of a Wiki project. <noinclude>__TOC__</noinclude> == {{Anchor|template}} Functions for templates == No direct usage by templates. == {{Anchor|Lua}} Functions for Lua modules (API) == The Lua Scribunto <code>Debug Console</code> is a safe, interactive tool for learning Modul:LuaWiki. # Click <code>Edit source</code> on the [[Modul:LuaWiki]] page. # Do '''not''' modify the Lua code in the editor and do <span style="color:#ff0000;">'''not'''</span> click <code>Publish changes</code>. # Scroll to the bottom of the page to the <code>Debug console</code> section. # Paste the following into the <span style="color:#86888c;">gray</span> input box (above the <code>Clear</code> button). <blockquote><syntaxhighlight lang="lua" line highlight=1 copy> local LuaWiki = require("Modul:LuaWiki") -- load the LuaWiki module print(type(LuaWiki)) -- A Lua module must return a table print(LuaWiki.isExisting("Modul:LuaWiki")) -- Does Modul:LuaWiki exist? print(LuaWiki.getVariable("PAGENAME", false)) -- Get the title of the current page </syntaxhighlight></blockquote> <ol start="5"> <li>Press {{key press|Enter}} once to execute all Lua command''s''.</li> <li>The result will appear below the Lua <syntaxhighlight lang="lua" inline>print</syntaxhighlight> command line:</li> </ol> <blockquote><syntaxhighlight lang="lua" line start=5> table true LuaWiki </syntaxhighlight></blockquote> <ol start="7"> <li>Press <code>Up arrow</code> (↑) to cycle through previous Lua commands.</li> <li>Optionally, click <code>Clear</code> to clear ''only'' the <code>Debug Console</code>; the Lua editor above will remain '''un'''modified.</li> </ol> Thereafter the functions can be accessed<!-- Obsolete; do not forget [[#init|initialization]]-->. ; LuaWiki.getArg(arg, assign) : Retrieve template argument :* <code>arg</code> – ''string'' or ''number''; argument identifier :* <code>assign</code> – optional; default value of any type, if not provided in template transclusion :* Returns: string (ensured) or default value orherwise : If not set in template transclusion and no default value, then: <code>{{{&lt;</code>''arg''<code>>}}}</code> ; LuaWiki.getVariable(seek, numeric) : Retrieve item from wikiVariables; populate if not yet present; see [[:de:Hilfe:Variablen]] :* <code>seek</code> – ''string''; name of variable, like <code>"PAGENAME"</code> :* <code>numeric</code> – ''boolean'', optional; true: seek is numeric (else string) :* Returns: ''string'' or ''number'' : Previous initialization with ''initVariables'' accelerates but ist not mandatory. ; LuaWiki.initVariables(request) : Initialization of some required variables for acceleration :* <code>request</code> – ''table''; selection of variables :*: every element either: :*:* ''string''; name of variable, like <code>"PAGENAME"</code> :*:* ''table''; variable is always returned as numerical value :*:** [1] ''string''; name of variable :*:** [2] <code>true</code> :* Returns: ''none'' ; LuaWiki.isExisting(seek) : Test page existence; like <code>#ifexist</code> :* <code>seek</code> – ''string''; full page name :* Returns: ''boolean'' ; <s>LuaWiki.setFrame(frame)</s> : Deprecated: Initialize frame for this utility by current template environment :* <code>frame</code> – <code>frame</code> object :* Returns: ''none'' ; LuaWiki.transclude(s, args) : Save transclusion of a page, or error message :* <code>s</code> – ''string''; full page name (if namespace not provided <code>Template:</code> will be used) :* <code>args</code> – ''table'', optional; arguments :* Returns: ''string''; transclusion or error message if page missing ; LuaWiki.error(msg) : HTML generator of error message :* <code>msg</code> – ''string''; error message :* Returns: ''string''; HTML error message In Debug console of [[Modul:LuaWiki]]: <blockquote><syntaxhighlight lang="lua" line highlight=2 copy> local LuaWiki = require("Modul:LuaWiki") -- load the LuaWiki module print(LuaWiki.getArg("argUnknown")) -- Get unknown arg print(LuaWiki.error("LuaWiki.setFrame(frame) is deprecated")) -- setFrame doesn't exist </syntaxhighlight></blockquote> <!-- Obsolete {{Anchor|init}} The initialization is important: On start the <code>frame</code> object of current template environment needs to be set by <code style="white-space: nowrap">LuaWiki.setFrame( frame )</code>&nbsp;– this won’t be checked any more. --> == Usage == General library; no limitations. == Dependencies == None. == Origin == * [[:de:Vorlage:LuaWiki]] - 2013-05-04 dvrs83ofeutdi53tk1tfc2dsu2xc8ko 391004 391003 2026-05-17T14:10:02Z Nimmzo 28254 /* {{Anchor|Lua}} Functions for Lua modules (API) */ Added expected error message and the conclusion: [[Module:LuaWiki]] remains unmodified 391004 wikitext text/x-wiki {{LuaModuleDoc}} <onlyinclude> '''<code>LuaWiki</code>''' – Module with functions for Lua programming in context of a Wiki project. <noinclude>__TOC__</noinclude> == {{Anchor|template}} Functions for templates == No direct usage by templates. == {{Anchor|Lua}} Functions for Lua modules (API) == The Lua Scribunto <code>Debug Console</code> is a safe, interactive tool for learning Modul:LuaWiki. # Click <code>Edit source</code> on the [[Modul:LuaWiki]] page. # Do '''not''' modify the Lua code in the editor and do <span style="color:#ff0000;">'''not'''</span> click <code>Publish changes</code>. # Scroll to the bottom of the page to the <code>Debug console</code> section. # Paste the following into the <span style="color:#86888c;">gray</span> input box (above the <code>Clear</code> button). <blockquote><syntaxhighlight lang="lua" line highlight=1 copy> local LuaWiki = require("Modul:LuaWiki") -- load the LuaWiki module print(type(LuaWiki)) -- A Lua module must return a table print(LuaWiki.isExisting("Modul:LuaWiki")) -- Does Modul:LuaWiki exist? print(LuaWiki.getVariable("PAGENAME", false)) -- Get the title of the current page </syntaxhighlight></blockquote> <ol start="5"> <li>Press {{key press|Enter}} once to execute all Lua command''s''.</li> <li>The result will appear below the Lua <syntaxhighlight lang="lua" inline>print</syntaxhighlight> command line:</li> </ol> <blockquote><syntaxhighlight lang="lua" line start=5> table true LuaWiki </syntaxhighlight></blockquote> <ol start="7"> <li>Press <code>Up arrow</code> (↑) to cycle through previous Lua commands.</li> <li>Optionally, click <code>Clear</code> to clear ''only'' the <code>Debug Console</code>; the Lua editor above will remain '''un'''modified.</li> </ol> Thereafter the functions can be accessed<!-- Obsolete; do not forget [[#init|initialization]]-->. ; LuaWiki.getArg(arg, assign) : Retrieve template argument :* <code>arg</code> – ''string'' or ''number''; argument identifier :* <code>assign</code> – optional; default value of any type, if not provided in template transclusion :* Returns: string (ensured) or default value orherwise : If not set in template transclusion and no default value, then: <code>{{{&lt;</code>''arg''<code>>}}}</code> ; LuaWiki.getVariable(seek, numeric) : Retrieve item from wikiVariables; populate if not yet present; see [[:de:Hilfe:Variablen]] :* <code>seek</code> – ''string''; name of variable, like <code>"PAGENAME"</code> :* <code>numeric</code> – ''boolean'', optional; true: seek is numeric (else string) :* Returns: ''string'' or ''number'' : Previous initialization with ''initVariables'' accelerates but ist not mandatory. ; LuaWiki.initVariables(request) : Initialization of some required variables for acceleration :* <code>request</code> – ''table''; selection of variables :*: every element either: :*:* ''string''; name of variable, like <code>"PAGENAME"</code> :*:* ''table''; variable is always returned as numerical value :*:** [1] ''string''; name of variable :*:** [2] <code>true</code> :* Returns: ''none'' ; LuaWiki.isExisting(seek) : Test page existence; like <code>#ifexist</code> :* <code>seek</code> – ''string''; full page name :* Returns: ''boolean'' ; <s>LuaWiki.setFrame(frame)</s> : Deprecated: Initialize frame for this utility by current template environment :* <code>frame</code> – <code>frame</code> object :* Returns: ''none'' ; LuaWiki.transclude(s, args) : Save transclusion of a page, or error message :* <code>s</code> – ''string''; full page name (if namespace not provided <code>Template:</code> will be used) :* <code>args</code> – ''table'', optional; arguments :* Returns: ''string''; transclusion or error message if page missing ; LuaWiki.error(msg) : HTML generator of error message :* <code>msg</code> – ''string''; error message :* Returns: ''string''; HTML error message In Debug console of [[Modul:LuaWiki]]: <blockquote><syntaxhighlight lang="lua" line highlight=2 copy> local LuaWiki = require("Modul:LuaWiki") -- load the LuaWiki module print(LuaWiki.getArg("argUnknown")) -- Get unknown arg print(LuaWiki.error("LuaWiki.setFrame(frame) is deprecated")) -- setFrame doesn't exist </syntaxhighlight></blockquote> <blockquote><syntaxhighlight lang="lua" line start=4> {{{<argUnknown>}}} Lua-zmylk: LuaWiki.setFrame(frame) is deprecated. Wróćoslědowanje: [C]: in function "error" Modul:LuaWiki:32: in function "error" console input:13: ? [C]: ? </syntaxhighlight></blockquote> # Click <code>Cancel</code> beneath the Lua editor. # The <code>Module:</code>LuaWiki remains '''un'''modified. <!-- Obsolete {{Anchor|init}} The initialization is important: On start the <code>frame</code> object of current template environment needs to be set by <code style="white-space: nowrap">LuaWiki.setFrame( frame )</code>&nbsp;– this won’t be checked any more. --> == Usage == General library; no limitations. == Dependencies == None. == Origin == * [[:de:Vorlage:LuaWiki]] - 2013-05-04 8ezfelkurk7skhjkn3ap8ol2ypqsjak Modul:Key 828 41644 390996 2026-05-17T12:50:03Z Nimmzo 28254 Copy Lua module from [[en:Module:Key]] 390996 Scribunto text/plain -- This module implements {{key press}}. local kbdPrefix = '<kbd class="keyboard-key nowrap">' local kbdSuffix = '</kbd>' local keyText = { ['caps lock'] = '⇪ Caps Lock', ['[[caps lock]]'] = '⇪ [[Caps Lock]]', ['shift'] = '⇧ Shift', ['[[shift key|shift]]'] = '⇧ [[Shift key|Shift]]', ['enter'] = '↵ Enter', ['[[enter key|enter]]'] = '↵ [[Enter key|Enter]]', ['cmd'] = '⌘ Cmd', ['[[command key|cmd]]'] = '⌘ [[Command key|Cmd]]', ['command'] = '⌘ Command', ['[[command key|command]]'] = '⌘ [[Command key|Command]]', ['opt'] = '⌥ Opt', ['[[option key|opt]]'] = '⌥ [[Option key|Opt]]', ['option'] = '⌥ Option', ['[[option key|option]]'] = '⌥ [[Option key|Option]]', ['tab'] = 'Tab ↹', ['[[tab key|tab]]'] = '[[Tab key|Tab]] ↹', ['backspace'] = '← Backspace', ['[[backspace]]'] = '← [[Backspace]]', ['win'] = '⊞ Win', ['[[windows key|win]]'] = '⊞ [[Windows key|Win]]', ['menu'] = '≣ Menu', ['[[menu key|menu]]'] = '≣ [[Menu key|Menu]]', ['up'] = '↑', ['[[arrow keys|up]]'] = '[[Arrow keys|↑]]', ['down'] = '↓', ['[[arrow keys|down]]'] = '[[Arrow keys|↓]]', ['left'] = '←', ['[[arrow keys|left]]'] = '[[Arrow keys|←]]', ['right'] = '→', ['[[arrow keys|right]]'] = '[[Arrow keys|→]]', ['asterisk'] = '&#42;', ['hash'] = '&#35;', ['[[#]]'] = '[[Number sign|#]]', ['colon'] = '&#58;', ['[[:]]'] = '[[Colon (punctuation)|:]]', ['pipe'] = '&#124;', ['[[|]]'] = '[[Pipe symbol|&#124;]]', ['semicolon'] = '&#59;', ['[[;]]'] = '[[Semi-colon|&#59;]]', ['equals'] = '&#61;', -- Left & right analog sticks. ['l up'] = 'L↑', ['l down'] = 'L↓', ['l left'] = 'L←', ['l right'] = 'L→', ['l ne'] = 'L↗', ['l se'] = 'L↘', ['l nw'] = 'L↖', ['l sw'] = 'L↙', ['r up'] = 'R↑', ['r down'] = 'R↓', ['r left'] = 'R←', ['r right'] = 'R→', ['r ne'] = 'R↗', ['r se'] = 'R↘', ['r nw'] = 'R↖', ['r sw'] = 'R↙', -- PlayStation. ['ex'] = '×', ['circle'] = '○', ['square'] = '□', ['triangle'] = '△', -- Nintendo 64 and GameCube. ['c up'] = 'C↑', ['c down'] = 'C↓', ['c left'] = 'C←', ['c right'] = 'C→', ['c ne'] = 'C↗', ['c se'] = 'C↘', ['c nw'] = 'C↖', ['c sw'] = 'C↙', } local keyAlias = { -- ['alternate name for key (alias)'] = 'name for key used in key table' ['[[cmd key|cmd]]'] = '[[command key|cmd]]', ['[[cmd key|command]]'] = '[[command key|command]]', ['[[opt key|opt]]'] = '[[option key|opt]]', ['[[option key]]'] = '[[option key|option]]', ['[[opt key|option]]'] = '[[option key|option]]', ['[[win key|win]]'] = '[[windows key|win]]', ['*'] = 'asterisk', ['#'] = 'hash', [':'] = 'colon', [';'] = 'semicolon', ['l-up'] = 'l up', ['l-down'] = 'l down', ['l-left'] = 'l left', ['l-right'] = 'l right', ['l-ne'] = 'l ne', ['l-se'] = 'l se', ['l-nw'] = 'l nw', ['l-sw'] = 'l sw', ['r-up'] = 'r up', ['r-down'] = 'r down', ['r-left'] = 'r left', ['r-right'] = 'r right', ['r-ne'] = 'r ne', ['r-se'] = 'r se', ['r-nw'] = 'r nw', ['r-sw'] = 'r sw', ['ps x'] = 'ex', ['ps c'] = 'circle', ['ps s'] = 'square', ['ps t'] = 'triangle', ['c-up'] = 'c up', ['c-down'] = 'c down', ['c-left'] = 'c left', ['c-right'] = 'c right', ['c-ne'] = 'c ne', ['c-se'] = 'c se', ['c-nw'] = 'c nw', ['c-sw'] = 'c sw', } local Collection = {} Collection.__index = Collection do function Collection:add(item) if item ~= nil then self.n = self.n + 1 self[self.n] = item end end function Collection:join(sep) return table.concat(self, sep) end function Collection:sort(comp) table.sort(self, comp) end function Collection.new() return setmetatable({n = 0}, Collection) end end local function keyPress(args) local chainNames = { 'chain first', 'chain second', 'chain third', 'chain fourth', 'chain fifth', 'chain sixth', 'chain seventh', 'chain eighth', 'chain ninth', } local result = Collection.new() local chainDefault = args.chain or '+' for i, id in ipairs(args) do if i > 1 then result:add(args[chainNames[i - 1]] or chainDefault) end local lc = id:lower() local text = keyText[lc] or keyText[keyAlias[lc]] or id result:add(kbdPrefix .. text .. kbdSuffix) end return mw.getCurrentFrame():extensionTag{ name = 'templatestyles', args = { src = 'Template:Key press/styles.css'} } .. result:join() end local function keypress(frame) -- Called by "{{key press|...}}". -- Using the template doubles the post‐expand include size. return keyPress(frame:getParent().args) end local function press(frame) -- Called by "{{#invoke:key|press|...}}". return keyPress(frame.args) end return { keypress = keypress, press = press, } dsj5a5986yf1b9d1av9u7wdz0fptyrs Předłoha:Key press 10 41645 390997 2026-05-17T13:00:05Z Nimmzo 28254 Copy from [[en:Template:Key press]] 390997 wikitext text/x-wiki <includeonly>{{{{{♥|safesubst:}}}#invoke:key|keypress}}</includeonly><noinclude> {{documentation}} </noinclude> 4j2emwcxmf4dx4zblg3n3h8o0vkve67 Předłoha:Key press/styles.css 10 41646 390998 2026-05-17T13:10:07Z Nimmzo 28254 Copy from [[en:Template:Key press/styles.css]] 390998 sanitized-css text/css /* {{pp-template}} */ .keyboard-key { border: 1px solid #aaa; border-radius: 0.2em; box-shadow: 0.1em 0.1em 0.2em rgba(0, 0, 0, 0.1); background-color: var(--background-color-neutral-subtle, #f8f9fa); background-image: linear-gradient(to bottom, var(--background-color-neutral, #eaecf0), var(--background-color-neutral-subtle, #f8f9fa), var(--background-color-neutral, #eaecf0)); color: var(--color-base, #202122); padding: 0.1em 0.3em; font-family: inherit; font-size: 0.85em; } ju6ncl0rj4jerf8mff9ywt3joykx897 Diskusija z wužiwarjom:Nimmzo 3 41647 391002 2026-05-17T13:50:15Z Nimmzo 28254 Created empty Talk page to avoid red wikilink ("Talk" | contribs) in History 391002 wikitext text/x-wiki phoiac9h4m842xq45sp7s6u21eteeq1