વિભાગ:OutputBuffer/doc: આવૃત્તિઓ વચ્ચેનો તફાવત

Content deleted Content added
નાનું en:Module:OutputBuffer/doc માંથી આયાત કરેલ ૨ પુનરાવર્તનો
નાનું Bot: Replace deprecated <source> tag and "enclose" parameter [https://lists.wikimedia.org/pipermail/wikitech-ambassadors/2020-April/002284.html]
 
લીટી ૫:
First, load the module.
 
<sourcesyntaxhighlight lang="lua">
local newBuffer = require('Module:OutputBuffer')
</syntaxhighlight>
</source>
 
Then, create the buffer and the functions that act on it.
 
<sourcesyntaxhighlight lang="lua">
local getBuffer, print, printf = newBuffer()
</syntaxhighlight>
</source>
 
=== getBuffer ===
 
<sourcesyntaxhighlight lang="lua">
local text = getBuffer(sep)
</syntaxhighlight>
</source>
 
Returns the contents of the buffer, with an optional separator string <var>sep</var>.
લીટી ૨૫:
=== print ===
 
<sourcesyntaxhighlight lang="lua">
print(s)
</syntaxhighlight>
</source>
 
Adds the string <var>s</var> to the buffer.
લીટી ૩૩:
=== printf ===
 
<sourcesyntaxhighlight lang="lua">
printf(s, ...)
</syntaxhighlight>
</source>
 
Adds the string <var>s</var> to the buffer. The string is formatted with any subsequent arguments, following the rules used for [[mw:Extension:Scribunto/Lua reference manual#String.format|string.format]].
લીટી ૪૧:
== Example ==
 
<sourcesyntaxhighlight lang="lua">
local newBuffer = require('Module:OutputBuffer')
local p = {}
લીટી ૫૭:
-- {{#invoke:TestModule|main}} would output:
-- "Welcome to the English Wikipedia. There are currently 4500000 articles on this site."
</syntaxhighlight>
</source>
 
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |