Zum Inhalt springen

„Wikipedia:Lua/Modul/Hello/en“ – Versionsunterschied

aus Wikipedia, der freien Enzyklopädie
Inhalt gelöscht Inhalt hinzugefügt
update
update
 
Zeile 31: Zeile 31:


== Origin ==
== Origin ==
[[:en:Module:Bananas]] and others.
[[:en:Module:Bananas]] (2012/2013), meanwhile like [[:en:Module:Example]].

Aktuelle Version vom 31. Oktober 2023, 13:50 Uhr

Vorlagenprogrammierung Diskussionen Lua Test Unterseiten
Modul Deutsch English

Modul: Dokumentation

Hello – module for demonstration of Lua usage within a Wiki-project.

Functions for templates

[Quelltext bearbeiten]
hello
Returns a string like Hello, world! This is Lua!
  • 1(optional) name of the recipient
    • Default: world

Syntax example

[Quelltext bearbeiten]

For templates this means:

  • without parameter: {{#invoke:Hello|hello}}
    • yields: Hallo, Welt! Dies ist Lua!
  • with parameter: {{#invoke:Hello|hello|John Doe}}
    • yields: Hallo, John Doe! Dies ist Lua!

Functions for Lua modules

[Quelltext bearbeiten]

(None which could be called via require)

Local implementation

[Quelltext bearbeiten]
hello(frame)
Returns the string.
frame – Call environment
  • frame.args[ 1 ] – Passed first unnamed parameter: name of the recipient

Dependencies

[Quelltext bearbeiten]

(No other module required)

Any test scenario.

en:Module:Bananas (2012/2013), meanwhile like en:Module:Example.